DDraw: return DDERR_NOPALETTEATTACHED if no palette is attached

Stefan Dösinger stefandoesinger at gmx.at
Sat Sep 9 06:45:19 CDT 2006


This is a revival of an old patch to allow native d3drm.dll to come further 
during startup. This time SetPalette is also modified to deal with the 
returned error, so the D3DIM examples using palettized textures aren't 
broken.

d3drm.dll still doesn't work, but this is another step to get it working.
-------------- next part --------------
From d3d3103faacc3e93df63c546f103285f6508b850 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Stefan_D=F6singer?= <stefan at codeweavers.com>
Date: Sat, 9 Sep 2006 13:26:15 +0200
Subject: [PATCH] DDraw: Return DDERR_NOPALETTEATTACHED if no palette is attached
---
 dlls/ddraw/surface.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 25fca51..cea715f 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -2027,6 +2027,7 @@ IDirectDrawSurfaceImpl_GetPalette(IDirec
     else
     {
         *Pal = NULL;
+        hr = DDERR_NOPALETTEATTACHED;
     }
 
     return hr;
@@ -2098,7 +2099,7 @@ IDirectDrawSurfaceImpl_SetPalette(IDirec
 
     /* Find the old palette */
     hr = IDirectDrawSurface_GetPalette(iface, &oldPal);
-    if(hr != DD_OK) return hr;
+    if(hr != DD_OK && hr != DDERR_NOPALETTEATTACHED) return hr;
     if(oldPal) IDirectDrawPalette_Release(oldPal);  /* For the GetPalette */
 
     /* Set the new Palette */
-- 
1.4.1.1



More information about the wine-patches mailing list