Code:
//Back Chams option
if(opt.chams.bChams)
{
if (iStride == 40)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
if(opt.chams.bChams==1) pDevice->SetTexture(0, White);
if(opt.chams.bChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.bChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.bChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.bChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.bChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.bChams==7) pDevice->SetTexture(0, Yellow);
if(opt.chams.bChams==8) pDevice->SetTexture(0, Orange);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
}
if (iStride == 44)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
if(opt.chams.bChams==1) pDevice->SetTexture(0, White);
if(opt.chams.bChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.bChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.bChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.bChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.bChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.bChams==7) pDevice->SetTexture(0, Yellow);
if(opt.chams.bChams==8) pDevice->SetTexture(0, Orange);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
}
if (iStride == 32)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
if(opt.chams.bChams==1) pDevice->SetTexture(0, White);
if(opt.chams.bChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.bChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.bChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.bChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.bChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.bChams==7) pDevice->SetTexture(0, Yellow);
if(opt.chams.bChams==8) pDevice->SetTexture(0, Orange);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
}
}
//Front Chams option
if(opt.chams.fChams)
{
if (iStride == 40)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
if(opt.chams.fChams==1) pDevice->SetTexture(0, White);
if(opt.chams.fChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.fChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.fChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.fChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.fChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.fChams==7) pDevice->SetTexture(0, Yellow);
if(opt.chams.fChams==8) pDevice->SetTexture(0, Orange);
}
if (iStride == 44)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
if(opt.chams.fChams==1) pDevice->SetTexture(0, White);
if(opt.chams.fChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.fChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.fChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.fChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.fChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.fChams==7) pDevice->SetTexture(0, Yellow);
if(opt.chams.fChams==8) pDevice->SetTexture(0, Orange);
}
if (iStride == 32)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
if(opt.chams.fChams==1) pDevice->SetTexture(0, White);
if(opt.chams.fChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.fChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.fChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.fChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.fChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.fChams==7) pDevice->SetTexture(0, Yellow);
if(opt.chams.fChams==8) pDevice->SetTexture(0, Orange);
}
}