[saco] Implement/match CNewPlayerTags::Begin()

This commit is contained in:
RD42 2024-07-28 22:43:02 +08:00
parent a79dde901d
commit af70f9d32c
2 changed files with 26 additions and 0 deletions

View File

@ -16,6 +16,31 @@ CNewPlayerTags::~CNewPlayerTags()
SAFE_DELETE(m_pSprite); SAFE_DELETE(m_pSprite);
} }
void CNewPlayerTags::Begin()
{
if (!m_pStates) {
RestoreDeviceObjects();
}
if(m_pStates)
m_pStates->Capture();
if(m_pSprite)
m_pSprite->Begin(D3DXSPRITE_DONOTSAVESTATE);
m_pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
m_pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
m_pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
m_pDevice->SetRenderState(D3DRS_ALPHATESTENABLE, 0);
m_pDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
m_pDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
m_pDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
m_pDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
m_pDevice->SetVertexShader(NULL);
m_pDevice->SetPixelShader(NULL);
m_pDevice->SetRenderState(D3DRS_ZENABLE, 0);
}
void CNewPlayerTags::DeleteDeviceObjects() void CNewPlayerTags::DeleteDeviceObjects()
{ {
SAFE_RELEASE(m_pStates); SAFE_RELEASE(m_pStates);

View File

@ -12,6 +12,7 @@ public:
CNewPlayerTags(IDirect3DDevice9* pDevice); CNewPlayerTags(IDirect3DDevice9* pDevice);
~CNewPlayerTags(); ~CNewPlayerTags();
void Begin();
void DeleteDeviceObjects(); void DeleteDeviceObjects();
void RestoreDeviceObjects(); void RestoreDeviceObjects();
}; };