[PATCH] Only update the drawable when we have a palette. This prevents issues in Red Alert.

Roderick Colenbrander thunderbird2k at gmx.net
Thu Feb 21 11:21:34 CST 2008


---
 dlls/wined3d/surface.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index f1217d9..c74c80f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3581,9 +3581,10 @@ HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
         SetDIBColorTable(This->hDC, 0, 256, col);
     }
 
-    /* Propagate the changes to the drawable.
+    /* Propagate the changes to the drawable when we have a palette. This function is also called
+     * when the palette is removed.
      * TODO: in case of hardware p8 palettes we should only upload the palette. */
-    if(This->resource.usage & WINED3DUSAGE_RENDERTARGET)
+    if(pal && (This->resource.usage & WINED3DUSAGE_RENDERTARGET))
         IWineD3DSurface_LoadLocation(iface, SFLAG_INDRAWABLE, NULL);
 
     return WINED3D_OK;
-- 
1.5.3.4


--========GMX202731203627843382913--



More information about the wine-patches mailing list