浏览代码

gpu: fix the computed element count in DrawIndexedElements on Direct3D.

legacy
Sam Hocevar sam 12 年前
父节点
当前提交
fa646c41c3
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      src/gpu/vertexbuffer.cpp

+ 5
- 1
src/gpu/vertexbuffer.cpp 查看文件

@@ -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();


正在加载...
取消
保存