|
|
@@ -199,20 +199,24 @@ void VertexDeclaration::DrawIndexedElements(MeshPrimitive type, int vbase, |
|
|
|
g_d3ddevice->SetRenderState(D3DRS_ALPHABLENDENABLE, 1); |
|
|
|
g_d3ddevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); |
|
|
|
g_d3ddevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); |
|
|
|
g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW); |
|
|
|
if (FAILED(g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW))) |
|
|
|
Abort(); |
|
|
|
switch (type) |
|
|
|
{ |
|
|
|
case MeshPrimitive::Triangles: |
|
|
|
count = count / 3; |
|
|
|
if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, |
|
|
|
vbase, vskip, vcount, skip, count))) |
|
|
|
Abort(); |
|
|
|
break; |
|
|
|
case MeshPrimitive::TriangleStrips: |
|
|
|
count = count - 2; |
|
|
|
if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP, |
|
|
|
vbase, vskip, vcount, skip, count))) |
|
|
|
Abort(); |
|
|
|
break; |
|
|
|
case MeshPrimitive::TriangleFans: |
|
|
|
count = count - 2; |
|
|
|
if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLEFAN, |
|
|
|
vbase, vskip, vcount, skip, count))) |
|
|
|
Abort(); |
|
|
|