This is old code of mine and is most likely a terrible way of doing it, I haven't made anything for WarRock in forever.
Code:
// Chams
if (Cham == 1)
{
if (Stride == 36)
{
switch (ChamC)
{ // Cham Body
case 1: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureRed);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureRed);break;
case 2: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureGreen);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureGreen);break;
case 3: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlue);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlue);break;
case 4: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureOrange);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureOrange);break;
case 5: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureCyan);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureCyan);break;
case 6: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, texturePink);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, texturePink);break;
case 7: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureWhite);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureWhite);break;
case 8: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlack);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlack);break;
}
}
if (Stride == 32)
{ // Cham Hands.
switch (ChamC2)
{
case 1: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureRed);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureRed);break;
case 2: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureGreen);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureGreen);break;
case 3: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlue);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlue);break;
case 4: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureOrange);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureOrange);break;
case 5: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureCyan);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureCyan);break;
case 6: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, texturePink);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, texturePink);break;
case 7: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureWhite);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureWhite);break;
case 8: pDevice->SetRenderState(D3DRS_ZENABLE,false);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlack);
pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
pDevice->SetRenderState(D3DRS_ZENABLE, true);
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
pDevice->SetTexture( 0, textureBlack);break;
}
}
}