Henri Verbeet : ddraw: Set DDPCAPS_PRIMARYSURFACE when attaching a palette to the primary surface .
Alexandre Julliard
julliard at winehq.org
Thu Dec 12 12:48:07 CST 2013
Module: wine
Branch: master
Commit: d5863f7f407b3fb5b8f5b5e32b42daccb34dc33e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d5863f7f407b3fb5b8f5b5e32b42daccb34dc33e
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Dec 12 10:23:33 2013 +0100
ddraw: Set DDPCAPS_PRIMARYSURFACE when attaching a palette to the primary surface.
---
dlls/ddraw/surface.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index a29f068..09dbb9c 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -4708,6 +4708,17 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDir
wined3d_mutex_lock();
prev = surface->palette;
+ if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
+ {
+ if (prev)
+ prev->flags &= ~DDPCAPS_PRIMARYSURFACE;
+ if (palette_impl)
+ palette_impl->flags |= DDPCAPS_PRIMARYSURFACE;
+ /* Update the wined3d frontbuffer if this is the primary. */
+ if (surface->ddraw->wined3d_frontbuffer)
+ wined3d_surface_set_palette(surface->ddraw->wined3d_frontbuffer,
+ palette_impl ? palette_impl->wineD3DPalette : NULL);
+ }
if (palette_impl)
IDirectDrawPalette_AddRef(&palette_impl->IDirectDrawPalette_iface);
if (prev)
@@ -4715,11 +4726,6 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDir
surface->palette = palette_impl;
wined3d_surface_set_palette(surface->wined3d_surface, palette_impl ? palette_impl->wineD3DPalette : NULL);
- /* Update the wined3d frontbuffer if this is the primary. */
- if ((surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) && surface->ddraw->wined3d_frontbuffer)
- wined3d_surface_set_palette(surface->ddraw->wined3d_frontbuffer,
- palette_impl ? palette_impl->wineD3DPalette : NULL);
-
wined3d_mutex_unlock();
return DD_OK;
More information about the wine-cvs
mailing list