From 1cbfe2d926decc77192b27517bf29dbd0de9cb21 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 2 Oct 2022 14:47:46 +0200 Subject: [PATCH] tweak clipper function logging --- inc/ddclipper.h | 1 + src/IDirectDraw/IDirectDrawClipper.c | 16 +++++++--------- src/ddclipper.c | 22 ++++++++++++++++++++-- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/inc/ddclipper.h b/inc/ddclipper.h index 0f5ba55..f9c02c4 100644 --- a/inc/ddclipper.h +++ b/inc/ddclipper.h @@ -9,6 +9,7 @@ HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSiz); HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd); +HRESULT ddc_IsClipListChanged(IDirectDrawClipperImpl* This, BOOL FAR* lpbChanged); HRESULT ddc_SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWORD dwFlags); HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd); HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter); diff --git a/src/IDirectDraw/IDirectDrawClipper.c b/src/IDirectDraw/IDirectDrawClipper.c index 1de1471..86aaaa6 100644 --- a/src/IDirectDraw/IDirectDrawClipper.c +++ b/src/IDirectDraw/IDirectDrawClipper.c @@ -52,8 +52,7 @@ HRESULT __stdcall IDirectDrawClipper__GetClipList( lpClipList, lpdwSiz); - HRESULT ret = DDERR_NOCLIPLIST; - //HRESULT ret = ddc_GetClipList(This, lpRect, lpClipList, lpdwSiz); + HRESULT ret = ddc_GetClipList(This, lpRect, lpClipList, lpdwSiz); TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); return ret; @@ -77,26 +76,25 @@ HRESULT __stdcall IDirectDrawClipper__Initialize(IDirectDrawClipperImpl* This, L HRESULT __stdcall IDirectDrawClipper__IsClipListChanged(IDirectDrawClipperImpl* This, BOOL FAR* lpbChanged) { - TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This); - HRESULT ret = DDERR_INVALIDOBJECT; - TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); + TRACE("-> %s(This=%p, lpbChanged=%p)\n", __FUNCTION__, This, lpbChanged); + HRESULT ret = ddc_IsClipListChanged(This, lpbChanged); + TRACE("<- %s\n", __FUNCTION__); return ret; } HRESULT __stdcall IDirectDrawClipper__SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWORD dwFlags) { TRACE("NOT_IMPLEMENTED -> %s(This=%p, lpClipList=%p, dwFlags=%08X)\n", __FUNCTION__, This, lpClipList, dwFlags); - //HRESULT ret = ddc_SetClipList(This, lpClipList, dwFlags); - HRESULT ret = DD_OK; + HRESULT ret = ddc_SetClipList(This, lpClipList, dwFlags); TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); return ret; } HRESULT __stdcall IDirectDrawClipper__SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd) { - TRACE("NOT_IMPLEMENTED -> %s(This=%p, dwFlags=%08X, hWnd=%p)\n", __FUNCTION__, This, dwFlags, hWnd); + TRACE("-> %s(This=%p, dwFlags=%08X, hWnd=%p)\n", __FUNCTION__, This, dwFlags, hWnd); HRESULT ret = ddc_SetHWnd(This, dwFlags, hWnd); - TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); + TRACE("<- %s\n", __FUNCTION__); return ret; } diff --git a/src/ddclipper.c b/src/ddclipper.c index a3bc388..30ba4ce 100644 --- a/src/ddclipper.c +++ b/src/ddclipper.c @@ -7,6 +7,9 @@ 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; @@ -42,6 +45,7 @@ HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA l return DDERR_REGIONTOOSMALL; return DD_OK; + */ } HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd) @@ -54,8 +58,19 @@ HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd) return DD_OK; } +HRESULT ddc_IsClipListChanged(IDirectDrawClipperImpl* This, BOOL FAR* lpbChanged) +{ + if (!lpbChanged) + return DDERR_INVALIDPARAMS; + + *lpbChanged = FALSE; /* Always return FALSE - See ddc_SetHWnd for remarks */ + + return DD_OK; +} + HRESULT ddc_SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWORD dwFlags) { + /* Keep this commented out until we found a game that actually needs it if (This->hwnd) return DDERR_CLIPPERISUSINGHWND; @@ -73,13 +88,16 @@ HRESULT ddc_SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWOR { This->region = NULL; } - + */ return DD_OK; } HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd) { - /* FIXME: need to set up This->region here (from hwnd region) */ + /* + We don't use the regions from the hwnd here since everything is emulated and we need the entire + emulated surface to be redrawn all the time + */ This->hwnd = hWnd; return DD_OK;