=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: ddraw: Alpha palettes can only be attached to textures.

Alexandre Julliard julliard at winehq.org
Wed May 7 15:18:15 CDT 2014


Module: wine
Branch: master
Commit: a227188573dc727dd6d2c53059c1c093a595be05
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a227188573dc727dd6d2c53059c1c093a595be05

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed May  7 15:16:37 2014 +0200

ddraw: Alpha palettes can only be attached to textures.

---

 dlls/ddraw/surface.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index d192348..349bbda 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -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;




More information about the wine-cvs mailing list