Module: wine Branch: master Commit: d6ecf5d14d50cde431e16afaf5d0e66baeb1da90 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d6ecf5d14d50cde431e16afaf5...
Author: Alexander Dorofeyev alexd4@inbox.lv Date: Tue May 6 00:49:32 2008 +0300
ddraw: Return DDERR_NOCOLORKEY when there is no colorkey.
---
dlls/ddraw/surface.c | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 3467a64..5f31c0a 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1490,9 +1490,6 @@ IDirectDrawSurfaceImpl_GetColorKey(IDirectDrawSurface7 *iface, DWORD Flags, DDCOLORKEY *CKey) { - /* There is a DDERR_NOCOLORKEY error, but how do we know if a color key - * isn't there? That's like saying that an int isn't there. (Which MS - * has done in other docs.) */ ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface); TRACE("(%p)->(%08x,%p)\n", This, Flags, CKey);
@@ -1500,21 +1497,42 @@ IDirectDrawSurfaceImpl_GetColorKey(IDirectDrawSurface7 *iface, return DDERR_INVALIDPARAMS;
EnterCriticalSection(&ddraw_cs); + switch (Flags) { case DDCKEY_DESTBLT: + if (!(This->surface_desc.dwFlags & DDSD_CKDESTBLT)) + { + LeaveCriticalSection(&ddraw_cs); + return DDERR_NOCOLORKEY; + } *CKey = This->surface_desc.ddckCKDestBlt; break;
case DDCKEY_DESTOVERLAY: + if (!(This->surface_desc.dwFlags & DDSD_CKDESTOVERLAY)) + { + LeaveCriticalSection(&ddraw_cs); + return DDERR_NOCOLORKEY; + } *CKey = This->surface_desc.u3.ddckCKDestOverlay; break;
case DDCKEY_SRCBLT: + if (!(This->surface_desc.dwFlags & DDSD_CKSRCBLT)) + { + LeaveCriticalSection(&ddraw_cs); + return DDERR_NOCOLORKEY; + } *CKey = This->surface_desc.ddckCKSrcBlt; break;
case DDCKEY_SRCOVERLAY: + if (!(This->surface_desc.dwFlags & DDSD_CKSRCOVERLAY)) + { + LeaveCriticalSection(&ddraw_cs); + return DDERR_NOCOLORKEY; + } *CKey = This->surface_desc.ddckCKSrcOverlay; break;