[PATCH 1/5] ddraw: Pass the number of vertices to DrawIndexedPrimitive

Stefan Dösinger stefan at codeweavers.com
Tue Dec 18 03:44:57 CST 2012


---
 dlls/ddraw/ddraw_private.h |    3 ++-
 dlls/ddraw/executebuffer.c |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index 85f6ca3..a0d7a4f 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -494,7 +494,8 @@ struct d3d_execute_buffer
     /* This buffer will store the transformed vertices */
     void                 *vertex_data;
     WORD                 *indices;
-    int                  nb_indices;
+    unsigned int         nb_indices;
+    unsigned int         nb_vertices;
 
     /* This flags is set to TRUE if we allocated ourselves the
      * data buffer
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
index 85625c1..f09460f 100644
--- a/dlls/ddraw/executebuffer.c
+++ b/dlls/ddraw/executebuffer.c
@@ -133,7 +133,8 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer,
                     instr += size;
                 }
                 IDirect3DDevice7_DrawIndexedPrimitive(&device->IDirect3DDevice7_iface,
-                        D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, tl_vx, 0, buffer->indices, count * 3, 0);
+                        D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, tl_vx, buffer->nb_vertices,
+                        buffer->indices, count * 3, 0);
 	    } break;
 
 	    case D3DOP_MATRIXLOAD:
@@ -711,6 +712,7 @@ static HRESULT WINAPI d3d_execute_buffer_SetExecuteData(IDirect3DExecuteBuffer *
     /* Prepares the transformed vertex buffer */
     HeapFree(GetProcessHeap(), 0, buffer->vertex_data);
     buffer->vertex_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nbvert * sizeof(D3DTLVERTEX));
+    buffer->nb_vertices = nbvert;
 
     if (TRACE_ON(ddraw))
         _dump_executedata(data);
-- 
1.7.8.6




More information about the wine-patches mailing list