From 0b6e99fa528e66bba6ca2923ed6e8ba185cfec38 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 7 Jun 2025 14:47:00 +0100 Subject: [PATCH] Fix a bug in `palette_update` PR #8027 exposed a bug in `palette_update`. The `first` argument in SDL palette functions always refers to the first target index (the first source index is always 0). --- Source/engine/palette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/engine/palette.cpp b/Source/engine/palette.cpp index e95e00ed9..0d299b288 100644 --- a/Source/engine/palette.cpp +++ b/Source/engine/palette.cpp @@ -139,7 +139,7 @@ void palette_update(int first, int ncolor) return; assert(Palette); - if (SDLC_SetSurfaceAndPaletteColors(PalSurface, Palette.get(), system_palette.data(), first, ncolor) < 0) { + if (SDLC_SetSurfaceAndPaletteColors(PalSurface, Palette.get(), system_palette.data() + first, first, ncolor) < 0) { ErrSdl(); } pal_surface_palette_version++;