DXGL r599 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r598‎ | r599 | r600 >
Date:01:29, 23 February 2015
Author:admin
Status:new
Tags:
Comment:
Fix drawing non-indexed primitives.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -958,6 +958,7 @@
959959 float tmpfloats[16];
960960 RECT *r1;
961961 RECT *r2;
 962+ WORD *indexptr;
962963 DDBLTFX *fxptr;
963964 glRenderer__InitGL(This, (DWORD)This->inputs[0], (DWORD)This->inputs[1], (DWORD)This->inputs[2],
964965 (BOOL)This->inputs[3],(DWORD)This->inputs[4], (HWND)This->inputs[5], (glDirectDraw7*)This->inputs[6]);
@@ -1084,10 +1085,11 @@
10851086 break;
10861087 case OP_DRAWPRIMITIVES:
10871088 if (This->queue[This->queue_read + 1] < 16) break;
 1089+ if (!This->queue[This->queue_read + 15 + (This->queue[This->queue_read + 14] / 4)]) indexptr = NULL;
 1090+ else indexptr = (WORD*)&This->queue[This->queue_read + 16 + (This->queue[This->queue_read + 14] / 4)];
10881091 glRenderer__DrawPrimitives(This, (glDirect3DDevice7*)This->queue[This->queue_read + 3], (GLenum)This->queue[This->queue_read+5],
10891092 (DWORD)This->queue[This->queue_read + 7], (BYTE*)&This->queue[This->queue_read+15], (DWORD)This->queue[This->queue_read + 9],
1090 - (DWORD)This->queue[This->queue_read + 11], (LPWORD)&This->queue[This->queue_read + 16+(This->queue[This->queue_read+14]/4)],
1091 - (DWORD)This->queue[This->queue_read + 13], 0);
 1093+ (DWORD)This->queue[This->queue_read + 11], indexptr, (DWORD)This->queue[This->queue_read + 13], 0);
10921094 break;
10931095 case OP_DELETEFBO:
10941096 if (This->queue[This->queue_read + 1] != 4) break;