DXGL r34 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r33‎ | r34 | r35 >
Date:02:44, 22 December 2011
Author:admin
Status:new
Tags:
Comment:
Fix IDirectDraw::PageLock and PageUnlock functions. Set DDCAPS2_NOPAGELOCKREQUIRED
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -776,7 +776,7 @@
777777 else ERR(DDERR_INVALIDPARAMS);
778778 ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTSTRETCH |
779779 DDCAPS_GDI | DDCAPS_PALETTE;
780 - ddCaps.dwCaps2 = DDCAPS2_CANRENDERWINDOWED | DDCAPS2_WIDESURFACES;
 780+ ddCaps.dwCaps2 = DDCAPS2_CANRENDERWINDOWED | DDCAPS2_WIDESURFACES | DDCAPS2_NOPAGELOCKREQUIRED;
781781 ddCaps.dwFXCaps = DDFXCAPS_BLTSHRINKX | DDFXCAPS_BLTSHRINKY |
782782 DDFXCAPS_BLTSTRETCHX | DDFXCAPS_BLTSTRETCHY;
783783 ddCaps.dwPalCaps = DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
Index: ddraw/glDirectDrawSurface.cpp
@@ -1131,22 +1131,14 @@
11321132 }
11331133 HRESULT WINAPI glDirectDrawSurface7::PageLock(DWORD dwFlags)
11341134 {
1135 - if(surfacetype == 1)
1136 - {
1137 - pagelocked++;
1138 - return DD_OK;
1139 - }
1140 - else ERR(DDERR_CANTPAGELOCK);
 1135+ pagelocked++;
 1136+ return DD_OK;
11411137 }
11421138 HRESULT WINAPI glDirectDrawSurface7::PageUnlock(DWORD dwFlags)
11431139 {
1144 - if(surfacetype == 1)
1145 - {
1146 - if(!pagelocked) ERR(DDERR_NOTPAGELOCKED);
1147 - pagelocked--;
1148 - return DD_OK;
1149 - }
1150 - else ERR(DDERR_CANTPAGEUNLOCK);
 1140+ if(!pagelocked) ERR(DDERR_NOTPAGELOCKED);
 1141+ pagelocked--;
 1142+ return DD_OK;
11511143 }
11521144 // ddraw 3+ api
11531145 HRESULT WINAPI glDirectDrawSurface7::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd2, DWORD dwFlags)