mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-14 22:03:27 +01:00
adjust clipper logging and make clipper less strict
This commit is contained in:
parent
9674705685
commit
94c718b5b1
@ -12,6 +12,7 @@ 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 ddc_SetClipRect(IDirectDrawClipperImpl* This, LPRECT lpRect);
|
||||
HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter);
|
||||
|
||||
#endif
|
||||
|
@ -47,7 +47,7 @@ HRESULT __stdcall IDirectDrawClipper__GetClipList(
|
||||
LPDWORD lpdwSiz)
|
||||
{
|
||||
TRACE(
|
||||
"NOT_IMPLEMENTED -> %s(This=%p, lpRect=%p, lpClipList=%p, lpdwSiz=%p)\n",
|
||||
"-> %s(This=%p, lpRect=%p, lpClipList=%p, lpdwSiz=%p)\n",
|
||||
__FUNCTION__,
|
||||
This,
|
||||
lpRect,
|
||||
@ -56,7 +56,7 @@ HRESULT __stdcall IDirectDrawClipper__GetClipList(
|
||||
|
||||
HRESULT ret = ddc_GetClipList(This, lpRect, lpClipList, lpdwSiz);
|
||||
|
||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||
TRACE("<- %s\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -86,9 +86,9 @@ HRESULT __stdcall IDirectDrawClipper__IsClipListChanged(IDirectDrawClipperImpl*
|
||||
|
||||
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);
|
||||
TRACE("-> %s(This=%p, lpClipList=%p, dwFlags=%08X)\n", __FUNCTION__, This, lpClipList, dwFlags);
|
||||
HRESULT ret = ddc_SetClipList(This, lpClipList, dwFlags);
|
||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||
TRACE("<- %s\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -172,6 +172,19 @@ HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd)
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT ddc_SetClipRect(IDirectDrawClipperImpl* This, LPRECT lpRect)
|
||||
{
|
||||
EnterCriticalSection(&This->cs);
|
||||
|
||||
if (This->region)
|
||||
DeleteObject(This->region);
|
||||
|
||||
This->region = CreateRectRgnIndirect(lpRect);
|
||||
|
||||
LeaveCriticalSection(&This->cs);
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter)
|
||||
{
|
||||
if (!lplpDDClipper)
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "utils.h"
|
||||
#include "blt.h"
|
||||
#include "config.h"
|
||||
#include "ddclipper.h"
|
||||
#include "versionhelpers.h"
|
||||
|
||||
|
||||
@ -90,7 +91,7 @@ HRESULT dds_Blt(
|
||||
{
|
||||
DWORD size = 0;
|
||||
|
||||
HRESULT result = IDirectDrawClipper_GetClipList(This->clipper, &dst_rect, NULL, &size);
|
||||
HRESULT result = ddc_GetClipList(This->clipper, &dst_rect, NULL, &size);
|
||||
|
||||
if (SUCCEEDED(result))
|
||||
{
|
||||
@ -98,7 +99,7 @@ HRESULT dds_Blt(
|
||||
|
||||
if (list)
|
||||
{
|
||||
if (SUCCEEDED(IDirectDrawClipper_GetClipList(This->clipper, &dst_rect, list, &size)))
|
||||
if (SUCCEEDED(ddc_GetClipList(This->clipper, &dst_rect, list, &size)))
|
||||
{
|
||||
RECT* dst_c_rect = (RECT*)list->Buffer;
|
||||
|
||||
@ -125,11 +126,13 @@ HRESULT dds_Blt(
|
||||
}
|
||||
else if (result == DDERR_NOCLIPLIST)
|
||||
{
|
||||
return DDERR_NOCLIPLIST;
|
||||
TRACE(" DDERR_NOCLIPLIST\n");
|
||||
//return DDERR_NOCLIPLIST;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DDERR_INVALIDCLIPLIST;
|
||||
TRACE(" DDERR_INVALIDCLIPLIST\n");
|
||||
//return DDERR_INVALIDCLIPLIST;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1023,12 +1026,8 @@ HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl* lpC
|
||||
|
||||
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);
|
||||
ddc_SetClipRect(lpClipper, &rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user