From 6e0ff4a4a40306a59c8b18d03ae86560e6a52a4a Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 11 Nov 2019 00:02:22 -0300 Subject: [PATCH] Recreate the CLUT when the palette changes --- src/v_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index 0a57e22ac..eaaa7cd26 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2218,13 +2218,15 @@ void InitColorLUT(void) { UINT8 r, g, b; static boolean clutinit = false; - if (!clutinit) + static RGBA_t *lastpalette = NULL; + if ((!clutinit) || (lastpalette != pLocalPalette)) { for (r = 0; r < CLUTSIZE; r++) for (g = 0; g < CLUTSIZE; g++) for (b = 0; b < CLUTSIZE; b++) colorlookup[r][g][b] = NearestColor(r << SHIFTCOLORBITS, g << SHIFTCOLORBITS, b << SHIFTCOLORBITS); clutinit = true; + lastpalette = pLocalPalette; } }