Commit 3c5b9557 authored by Günther Brammer's avatar Günther Brammer Committed by Alexandre Julliard

ddraw: Fix IDirectDrawSurfaceImpl_SetColorKey to also change surface_desc.

parent 367f91fb
...@@ -2037,6 +2037,58 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface, ...@@ -2037,6 +2037,58 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface,
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%x,%p)\n", This, Flags, CKey); TRACE("(%p)->(%x,%p)\n", This, Flags, CKey);
if (CKey)
{
switch (Flags & ~DDCKEY_COLORSPACE)
{
case DDCKEY_DESTBLT:
This->surface_desc.ddckCKDestBlt = *CKey;
This->surface_desc.dwFlags |= DDSD_CKDESTBLT;
break;
case DDCKEY_DESTOVERLAY:
This->surface_desc.u3.ddckCKDestOverlay = *CKey;
This->surface_desc.dwFlags |= DDSD_CKDESTOVERLAY;
break;
case DDCKEY_SRCOVERLAY:
This->surface_desc.ddckCKSrcOverlay = *CKey;
This->surface_desc.dwFlags |= DDSD_CKSRCOVERLAY;
break;
case DDCKEY_SRCBLT:
This->surface_desc.ddckCKSrcBlt = *CKey;
This->surface_desc.dwFlags |= DDSD_CKSRCBLT;
break;
default:
return DDERR_INVALIDPARAMS;
}
}
else
{
switch (Flags & ~DDCKEY_COLORSPACE)
{
case DDCKEY_DESTBLT:
This->surface_desc.dwFlags &= ~DDSD_CKDESTBLT;
break;
case DDCKEY_DESTOVERLAY:
This->surface_desc.dwFlags &= ~DDSD_CKDESTOVERLAY;
break;
case DDCKEY_SRCOVERLAY:
This->surface_desc.dwFlags &= ~DDSD_CKSRCOVERLAY;
break;
case DDCKEY_SRCBLT:
This->surface_desc.dwFlags &= ~DDSD_CKSRCBLT;
break;
default:
return DDERR_INVALIDPARAMS;
}
}
for(surf = This->first_complex; surf; surf = surf->next_complex) for(surf = This->first_complex; surf; surf = surf->next_complex)
{ {
hr = IWineD3DSurface_SetColorKey(surf->WineD3DSurface, hr = IWineD3DSurface_SetColorKey(surf->WineD3DSurface,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment