From c2d882fd885ba8dee4b2104a5c5009c544471752 Mon Sep 17 00:00:00 2001 From: narzoul Date: Wed, 7 Apr 2021 13:37:49 +0200 Subject: [PATCH] Unrealize palette when it becomes a foreground palette Fixes palette issues in Star Wars Rebellion. --- DDrawCompat/Gdi/Palette.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DDrawCompat/Gdi/Palette.cpp b/DDrawCompat/Gdi/Palette.cpp index 5b164df..7d234ea 100644 --- a/DDrawCompat/Gdi/Palette.cpp +++ b/DDrawCompat/Gdi/Palette.cpp @@ -134,7 +134,7 @@ namespace HPALETTE palette = reinterpret_cast(GetCurrentObject(hdc, OBJ_PAL)); if (!palette || GetStockObject(DEFAULT_PALETTE) == palette) { - return 0; + return LOG_RESULT(0); } PALETTEENTRY entries[256] = {}; @@ -203,6 +203,7 @@ namespace { Compat::ScopedSrwLockExclusive lock(g_srwLock); g_paletteInfo[hpal].isForeground = true; + g_paletteInfo[hpal].isRealized = false; } } }