@ bytecode : Yes, the mod's only change the textures / skins of the players and not the engine.
Thanks for the replies glad its helpfull.
As you probably have seen you could get some unwated things to be drawn trough walls with this. Like the flags and tank tires for example. A way around this is the following :
In the hooked SetVertexShaderConstant you don't change the values you just save them to a global variable and then apply the changes in DrawIndexedPrimitive like this :
PHP Code:
//Global
vshader_t m_verTex;
HRESULT APIENTRY hkIDirect3DDevice8::SetVertexShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount)
{
vshader_t *pv = (vshader_t*)pConstantData;
if(Register == 0 && ConstantCount == 9)
{
//Save the values in our global
m_verTex = *pv;
}
return m_pD3Ddev->SetVertexShaderConstant(Register, pConstantData, ConstantCount);
}
// This is how your DIP could look :
HRESULT APIENTRY hkIDirect3DDevice8::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
if(YourPlayerModelRec)
{
//Xqz wallhack effect
m_verTex.depth_4 = 1.0f;
// Lambert effect (kinda)
m_verTex.a_r = 1.0f;
m_verTex.a_g = 1.0f;
m_verTex.a_b = 1.0f;
m_verTex.a_a = 1.0f;
m_pD3Ddev->SetVertexShaderConstant(0,(CONST void *)&m_verTex,9);
return m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount);
}
return m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount);
}
Enjoy!
PS : Please, if you use this add the proper credits to your hack.