Changeset 2030


Ignore:
Timestamp:
Oct 19, 2012, 3:52:45 PM (11 years ago)
Author:
sam
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/vertexbuffer.cpp

    r1989 r2030  
    200200    g_d3ddevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
    201201    g_d3ddevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    202     g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
     202    if (FAILED(g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW)))
     203        Abort();
    203204    switch (type)
    204205    {
    205206    case MeshPrimitive::Triangles:
     207        count = count / 3;
    206208        if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,
    207209                                           vbase, vskip, vcount, skip, count)))
     
    209211        break;
    210212    case MeshPrimitive::TriangleStrips:
     213        count = count - 2;
    211214        if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP,
    212215                                           vbase, vskip, vcount, skip, count)))
     
    214217        break;
    215218    case MeshPrimitive::TriangleFans:
     219        count = count - 2;
    216220        if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLEFAN,
    217221                                           vbase, vskip, vcount, skip, count)))
Note: See TracChangeset for help on using the changeset viewer.