//----- (10068FD0) -------------------------------------------------------- HRESULT…
- User
//----- (10068FD0) -------------------------------------------------------- HRESULT __thiscall CPlayerTags::BeginHealthBar(CPlayerTags *this) { IDirect3DStateBlock9 **p_m_pStates; // edi ID3DXSprite *m_pSprite; // eax ID3DXSprite *v4; // eax
p_m_pStates = &this->m_pStates; if ( this->m_pStates ) goto LABEL_6; m_pSprite = this->m_pSprite; if ( m_pSprite ) (*(void (__stdcall **)(ID3DXSprite ))((_DWORD *)m_pSprite + 52))(this->m_pSprite); if ( *p_m_pStates || (this->m_pDevice->lpVtbl->CreateStateBlock(this->m_pDevice, D3DSBT_ALL, p_m_pStates), *p_m_pStates) ) { LABEL_6: (*p_m_pStates)->lpVtbl->Capture(p_m_pStates); } v4 = this->m_pSprite; if ( v4 ) ((void (__stdcall **)(ID3DXSprite , int))((_DWORD *)v4 + 32))(v4, 1); this->m_pDevice->lpVtbl->SetRenderState(this->m_pDevice, D3DRS_ALPHABLENDENABLE, 1); this->m_pDevice->lpVtbl->SetRenderState(this->m_pDevice, D3DRS_SRCBLEND, 5); this->m_pDevice->lpVtbl->SetRenderState(this->m_pDevice, D3DRS_DESTBLEND, 6); this->m_pDevice->lpVtbl->SetRenderState(this->m_pDevice, D3DRS_ALPHATESTENABLE, 0); this->m_pDevice->lpVtbl->SetTextureStageState(this->m_pDevice, 0, D3DTSS_COLOROP, 3); this->m_pDevice->lpVtbl->SetTextureStageState(this->m_pDevice, 0, D3DTSS_COLORARG2, 0); this->m_pDevice->lpVtbl->SetTextureStageState(this->m_pDevice, 0, D3DTSS_ALPHAOP, 2); this->m_pDevice->lpVtbl->SetTextureStageState(this->m_pDevice, 0, D3DTSS_ALPHAARG1, 0); this->m_pDevice->lpVtbl->SetVertexShader(this->m_pDevice, 0); this->m_pDevice->lpVtbl->SetPixelShader(this->m_pDevice, 0); return this->m_pDevice->lpVtbl->SetRenderState(this->m_pDevice, D3DRS_ZENABLE, 0); } чо делает эта функция
- Assistant
The function
CPlayerTags::BeginHealthBarappears to be initializing and setting up rendering states for a health bar.Here's a breakdown of what it does:
-
State Block Management:
- It checks if a state block (
m_pStates) already exists. If not, it attempts to create one usingCreateStateBlock. This state block is used to capture the current state of the Direct3D device to allow for resetting or restoring it later. - If a state block exists, it captures the current state using .
- It checks if a state block (
-