[PATCH] Don't flush changes to the screen when no palette is set. This prevents rendering issues at exit in Red Alert.

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


---
 dlls/wined3d/surface_gdi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c
index c0f54bc..5193e4a 100644
--- a/dlls/wined3d/surface_gdi.c
+++ b/dlls/wined3d/surface_gdi.c
@@ -657,10 +657,11 @@ HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
         SetDIBColorTable(This->hDC, 0, 256, col);
     }
 
-    /* Update the image because of the palette change. Some games like e.g Red Alert
-     * call SetEntries a lot to implement fading.
+    /* Update the image because of the palette change. Note that this function is also
+     * called on a palette removal. In such a case we don't have to update the screen.
+     * Some games like e.g Red Alert call SetEntries a lot to implement fading.
      */
-    if(This->resource.usage & WINED3DUSAGE_RENDERTARGET)
+    if(pal && This->resource.usage & WINED3DUSAGE_RENDERTARGET)
         x11_copy_to_screen(This, NULL);
 
     return WINED3D_OK;
-- 
1.5.3.4


--========GMX202761203627807583861--



More information about the wine-patches mailing list