wined3d: Simplify IWineD3DDeviceImpl_ProcessVertices().

This commit is contained in:
Henri Verbeet 2009-03-26 10:43:40 +01:00 committed by Alexandre Julliard
parent c1a42ff024
commit a7d6128547
1 changed files with 17 additions and 23 deletions

View File

@ -4680,30 +4680,24 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
* *
* Also get the start index in, but only loop over all elements if there's something to add at all. * Also get the start index in, but only loop over all elements if there's something to add at all.
*/ */
#define FIXSRC(type) \ for (i = 0; i < (sizeof(strided.u.input) / sizeof(*strided.u.input)); ++i)
if(strided.u.s.type.VBO) { \ {
struct wined3d_buffer *vb = (struct wined3d_buffer *)This->stateBlock->streamSource[strided.u.s.type.streamNo]; \ if (strided.u.input[i].VBO)
strided.u.s.type.VBO = 0; \ {
strided.u.s.type.lpData = (BYTE *) ((unsigned long) strided.u.s.type.lpData + (unsigned long) vb->resource.allocatedMemory); \ struct wined3d_buffer *vb =
ENTER_GL(); \ (struct wined3d_buffer *)This->stateBlock->streamSource[strided.u.input[i].streamNo];
GL_EXTCALL(glDeleteBuffersARB(1, &vb->buffer_object)); \ strided.u.input[i].VBO = 0;
vb->buffer_object = 0; \ strided.u.input[i].lpData = (BYTE *)((unsigned long)strided.u.input[i].lpData + (unsigned long)vb->resource.allocatedMemory);
LEAVE_GL(); \ ENTER_GL();
} \ GL_EXTCALL(glDeleteBuffersARB(1, &vb->buffer_object));
if(strided.u.s.type.lpData) { \ vb->buffer_object = 0;
strided.u.s.type.lpData += strided.u.s.type.dwStride * SrcStartIndex; \ LEAVE_GL();
}
if (strided.u.input[i].lpData)
{
strided.u.input[i].lpData += strided.u.input[i].dwStride * SrcStartIndex;
}
} }
FIXSRC(position);
FIXSRC(blendWeights);
FIXSRC(blendMatrixIndices);
FIXSRC(normal);
FIXSRC(pSize);
FIXSRC(diffuse);
FIXSRC(specular);
for(i = 0; i < WINED3DDP_MAXTEXCOORD; i++) {
FIXSRC(texCoords[i]);
}
#undef FIXSRC
} }
return process_vertices_strided(This, DestIndex, VertexCount, &strided, return process_vertices_strided(This, DestIndex, VertexCount, &strided,