mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
#177 support 2 more clipper functions - GetClipList and SetClipList - clipping not supported yet in dd_blt!
This commit is contained in:
parent
73e13dbe8c
commit
24f6a020d5
@ -15,6 +15,7 @@ typedef struct IDirectDrawClipperImpl
|
||||
|
||||
ULONG ref;
|
||||
HWND hwnd;
|
||||
HRGN region;
|
||||
|
||||
} IDirectDrawClipperImpl;
|
||||
|
||||
|
@ -7,7 +7,9 @@
|
||||
#include "IDirectDrawClipper.h"
|
||||
|
||||
|
||||
HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSiz);
|
||||
HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd);
|
||||
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);
|
||||
|
||||
|
@ -42,16 +42,16 @@ 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,
|
||||
lpClipList,
|
||||
lpdwSiz);
|
||||
|
||||
HRESULT ret = DDERR_NOCLIPLIST;
|
||||
HRESULT ret = ddc_GetClipList(This, lpRect, lpClipList, lpdwSiz);
|
||||
|
||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||
TRACE("<- %s\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -65,9 +65,9 @@ HRESULT __stdcall IDirectDrawClipper__GetHWnd(IDirectDrawClipperImpl* This, HWND
|
||||
|
||||
HRESULT __stdcall IDirectDrawClipper__Initialize(IDirectDrawClipperImpl* This, LPDIRECTDRAW lpDD, DWORD dwFlags)
|
||||
{
|
||||
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||
HRESULT ret = DD_OK;
|
||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||
TRACE("<- %s\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -81,9 +81,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);
|
||||
HRESULT ret = DD_OK;
|
||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||
TRACE("-> %s(This=%p, lpClipList=%p, dwFlags=%08X)\n", __FUNCTION__, This, lpClipList, dwFlags);
|
||||
HRESULT ret = ddc_SetClipList(This, lpClipList, dwFlags);
|
||||
TRACE("<- %s\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,42 @@
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSiz)
|
||||
{
|
||||
if (!This->region)
|
||||
return DDERR_NOCLIPLIST;
|
||||
|
||||
if (!lpdwSiz)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
HRGN region = NULL;
|
||||
|
||||
if (lpRect)
|
||||
{
|
||||
region = CreateRectRgnIndirect(lpRect);
|
||||
|
||||
if (!region)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
if (CombineRgn(region, This->region, region, RGN_AND) == ERROR)
|
||||
{
|
||||
DeleteObject(region);
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
region = This->region;
|
||||
}
|
||||
|
||||
*lpdwSiz = GetRegionData(region, *lpdwSiz, lpClipList);
|
||||
|
||||
if (lpRect)
|
||||
DeleteObject(region);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd)
|
||||
{
|
||||
if (!lphWnd)
|
||||
@ -15,6 +51,29 @@ HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd)
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT ddc_SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWORD dwFlags)
|
||||
{
|
||||
if (This->hwnd)
|
||||
return DDERR_CLIPPERISUSINGHWND;
|
||||
|
||||
if (This->region)
|
||||
DeleteObject(This->region);
|
||||
|
||||
if (lpClipList)
|
||||
{
|
||||
This->region = ExtCreateRegion(NULL, 0, lpClipList);
|
||||
|
||||
if (!This->region)
|
||||
return DDERR_INVALIDCLIPLIST;
|
||||
}
|
||||
else
|
||||
{
|
||||
This->region = NULL;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd)
|
||||
{
|
||||
This->hwnd = hWnd;
|
||||
|
Loading…
x
Reference in New Issue
Block a user