DXGL r930 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r929‎ | r930 | r931 >
Date:00:03, 22 May 2019
Author:admin
Status:new
Tags:
Comment:
Re-enable overlay support in DDraw caps.
Fix crash when attempting to render overlays. (still doesn't display)
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/glRenderer.h (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -1471,8 +1471,8 @@
14721472 if (ddCaps.dwSize < sizeof(DDCAPS_DX3)) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
14731473 ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTDEPTHFILL | DDCAPS_BLTFOURCC |
14741474 DDCAPS_BLTSTRETCH | DDCAPS_COLORKEY | DDCAPS_GDI | DDCAPS_PALETTE | DDCAPS_CANBLTSYSMEM |
1475 - DDCAPS_3D | DDCAPS_CANCLIP | DDCAPS_CANCLIPSTRETCHED | DDCAPS_READSCANLINE;/* |
1476 - DDCAPS_OVERLAY | DDCAPS_OVERLAYSTRETCH;*/
 1475+ DDCAPS_3D | DDCAPS_CANCLIP | DDCAPS_CANCLIPSTRETCHED | DDCAPS_READSCANLINE |
 1476+ DDCAPS_OVERLAY | DDCAPS_OVERLAYSTRETCH;
14771477 ddCaps.dwCaps2 = DDCAPS2_CANRENDERWINDOWED | DDCAPS2_WIDESURFACES | DDCAPS2_NOPAGELOCKREQUIRED |
14781478 DDCAPS2_FLIPINTERVAL | DDCAPS2_FLIPNOVSYNC | DDCAPS2_NONLOCALVIDMEM;
14791479 ddCaps.dwFXCaps = DDFXCAPS_BLTSHRINKX | DDFXCAPS_BLTSHRINKY |
@@ -1485,10 +1485,10 @@
14861486 DDSCAPS_FRONTBUFFER | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_PALETTE |
14871487 DDSCAPS_SYSTEMMEMORY | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE |
14881488 DDSCAPS_NONLOCALVIDMEM | DDSCAPS_LOCALVIDMEM | DDSCAPS_TEXTURE |
1489 - DDSCAPS_MIPMAP;// | DDSCAPS_OVERLAY;
 1489+ DDSCAPS_MIPMAP | DDSCAPS_OVERLAY;
14901490 ddCaps.ddsCaps.dwCaps2 = DDSCAPS2_MIPMAPSUBLEVEL;
1491 - //ddCaps.dwMinOverlayStretch = 1;
1492 - //ddCaps.dwMaxOverlayStretch = 2147483647;
 1491+ ddCaps.dwMinOverlayStretch = 1;
 1492+ ddCaps.dwMaxOverlayStretch = 2147483647;
14931493 ddCaps.dwCKeyCaps = DDCKEYCAPS_SRCBLT | DDCKEYCAPS_DESTBLT;
14941494 ddCaps.dwZBufferBitDepths = DDBD_16 | DDBD_24 | DDBD_32;
14951495 ddCaps.dwNumFourCCCodes = GetNumFOURCC();
Index: ddraw/glRenderer.cpp
@@ -2889,7 +2889,7 @@
28902890 glRenderer__DeleteTexture(This,(glTexture*)This->inputs[0]);
28912891 break;
28922892 case OP_BLT:
2893 - glRenderer__Blt(This, (BltCommand*)This->inputs[0]);
 2893+ glRenderer__Blt(This, (BltCommand*)This->inputs[0], FALSE);
28942894 break;
28952895 case OP_DRAWSCREEN:
28962896 glRenderer__DrawScreen(This,(glTexture*)This->inputs[0],(glTexture*)This->inputs[1],
@@ -3350,7 +3350,7 @@
33513351 }
33523352 }
33533353
3354 -void glRenderer__Blt(glRenderer *This, BltCommand *cmd)
 3354+void glRenderer__Blt(glRenderer *This, BltCommand *cmd, BOOL backend)
33553355 {
33563356 int rotates = 0;
33573357 BOOL usedest = FALSE;
@@ -3603,7 +3603,7 @@
36043604 !(ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP)))
36053605 glRenderer__DrawScreen(This,cmd->dest,cmd->dest->palette,0,NULL,FALSE,TRUE,NULL,0);
36063606 This->outputs[0] = DD_OK;
3607 - SetEvent(This->busy);
 3607+ if(!backend) SetEvent(This->busy);
36083608 }
36093609
36103610 void glRenderer__MakeTexture(glRenderer *This, glTexture *texture)
@@ -4174,7 +4174,7 @@
41754175 bltcmd.dest = primary;
41764176 bltcmd.destlevel = 0;
41774177 bltcmd.destrect = This->overlays[i].destrect;
4178 - glRenderer__Blt(This, &bltcmd);
 4178+ glRenderer__Blt(This, &bltcmd, TRUE);
41794179 }
41804180 }
41814181 }
Index: ddraw/glRenderer.h
@@ -206,7 +206,7 @@
207207 void glRenderer__DeleteCommandBuffer(CommandBuffer *cmd);
208208 void glRenderer__UploadTexture(glRenderer *This, glTexture *texture, GLint level);
209209 void glRenderer__DownloadTexture(glRenderer *This, glTexture *texture, GLint level);
210 -void glRenderer__Blt(glRenderer *This, BltCommand *cmd);
 210+void glRenderer__Blt(glRenderer *This, BltCommand *cmd, BOOL backend);
211211 void glRenderer__MakeTexture(glRenderer *This, glTexture *texture);
212212 void glRenderer__DrawScreen(glRenderer *This, glTexture *texture, glTexture *paltex, GLint vsync, glTexture *previous, BOOL setsync, BOOL settime, OVERLAY *overlays, int overlaycount);
213213 void glRenderer__DeleteTexture(glRenderer *This, glTexture *texture);