ddraw: Fix IDirectDrawSurfaceImpl_SetColorKey to also change surface_desc.

This commit is contained in:
Günther Brammer 2006-12-09 23:13:14 +01:00 committed by Alexandre Julliard
parent 367f91fb5c
commit 3c5b9557b5
1 changed files with 52 additions and 0 deletions

View File

@ -2037,6 +2037,58 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface,
HRESULT hr;
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)
{
hr = IWineD3DSurface_SetColorKey(surf->WineD3DSurface,