little fix
Code:
HRESULT ( APIENTRY *orig_DrawIndexedPrimitive) ( LPDIRECT3DDEVICE9,D3DPRIMITIVETYPE ,INT ,UINT ,UINT ,UINT ,UINT ) = (HRESULT ( APIENTRY *) ( LPDIRECT3DDEVICE9,D3DPRIMITIVETYPE ,INT ,UINT ,UINT ,UINT ,UINT ))DIP_F;
HRESULT APIENTRY DrawIndexedPrimitive_det(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
if(OneTime)
{
GenerateShader( pDevice, &re_Red, 255, 0, 0 );
GenerateShader( pDevice, &re_Green, 0, 255, 0 );
OneTime=false;
}
pDevice->SetPixelShader( NULL );
if( PlayerSkinnedModels )
{
pDevice->SetPixelShader(re_Red);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
orig_DrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex,primCount );
pDevice->SetPixelShader(re_Green);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
}
PlayerSkinnedModels = false;
return orig_DrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex,primCount );
}
Code:
typedef struct{
int Indices;
char z_crap[20];
}Skinned_t;
void (*orig_RB_TessXModelSkinnedCached) ( ) = (void ( *) ( ))DW_XModel;
void RB_TessXModelSkinnedCached( )
{
Skinned_t * Skin = NULL;
__asm mov Skin, eax
if( Skin->Indices )
{
PlayerSkinnedModels = true;
}
else
PlayerSkinnedModels = false;
__asm mov eax, Skin
orig_RB_TessXModelSkinnedCached( );
}
Bookmarks