ddraw: Pass the number of vertices to DrawIndexedPrimitive.

This commit is contained in:
Stefan Dösinger 2012-12-18 10:44:57 +01:00 committed by Alexandre Julliard
parent 671b977dd5
commit ea40a3a8b5
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

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