Просмотр исходного кода

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

legacy
Sam Hocevar sam 12 лет назад
Родитель
Сommit
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();


Загрузка…
Отмена
Сохранить