Commit d5863f7f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Set DDPCAPS_PRIMARYSURFACE when attaching a palette to the primary surface.

parent bf7f80f4
......@@ -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;
......
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