1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

#209 support clipper from hwnd for New Robinson

This commit is contained in:
FunkyFr3sh 2023-03-06 01:40:47 +01:00
parent d2557c66c8
commit e61e0d2321
2 changed files with 12 additions and 4 deletions

View File

@ -7,9 +7,6 @@
HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSiz)
{
return DDERR_NOCLIPLIST;
/* Keep this commented out until we found a game that actually needs it
if (!This->region)
return DDERR_NOCLIPLIST;
@ -45,7 +42,6 @@ HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA l
return DDERR_REGIONTOOSMALL;
return DD_OK;
*/
}
HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd)

View File

@ -988,8 +988,20 @@ HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl* lpClipper)
{
if (lpClipper)
{
IDirectDrawClipper_AddRef(lpClipper);
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && lpClipper->hwnd)
{
if (lpClipper->region)
DeleteObject(lpClipper->region);
RECT rc = { 0, 0, This->width, This->height };
lpClipper->region = CreateRectRgnIndirect(&rc);
}
}
if (This->clipper)
IDirectDrawClipper_Release(This->clipper);