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

make sure we always got a cliplist

This commit is contained in:
FunkyFr3sh 2024-09-02 14:49:11 +02:00
parent aac405031e
commit 649ba3050a

View File

@ -3,6 +3,7 @@
#include "IDirectDrawClipper.h"
#include "ddclipper.h"
#include "debug.h"
#include "dd.h"
HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSiz)
@ -168,6 +169,12 @@ HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd)
*/
This->hwnd = hWnd;
if (hWnd && !This->region && g_ddraw.width)
{
RECT rc = { 0, 0, g_ddraw.width, g_ddraw.height };
ddc_SetClipRect(This, &rc);
}
LeaveCriticalSection(&This->cs);
return DD_OK;
}