ddraw: Fix IDirectDrawSurfaceImpl_SetColorKey to also change surface_desc.
This commit is contained in:
parent
367f91fb5c
commit
3c5b9557b5
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue