ddraw: Alpha palettes can only be attached to textures.

This commit is contained in:
Stefan Dösinger 2014-05-07 15:16:37 +02:00 committed by Alexandre Julliard
parent 1558391a11
commit a227188573
1 changed files with 7 additions and 0 deletions

View File

@ -454,6 +454,13 @@ static HRESULT ddraw_surface_set_palette(struct ddraw_surface *surface, IDirectD
TRACE("iface %p, palette %p.\n", surface, palette);
if (palette_impl && palette_impl->flags & DDPCAPS_ALPHA
&& !(surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
{
WARN("Alpha palette set on non-texture surface, returning DDERR_INVALIDSURFACETYPE.\n");
return DDERR_INVALIDSURFACETYPE;
}
if (!(surface->surface_desc.u4.ddpfPixelFormat.dwFlags & (DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2
| DDPF_PALETTEINDEXED4 | DDPF_PALETTEINDEXED8 | DDPF_PALETTEINDEXEDTO8)))
return DDERR_INVALIDPIXELFORMAT;