Browse Source

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).
pull/7974/merge
Gleb Mazovetskiy 9 months ago
parent
commit
0b6e99fa52
  1. 2
      Source/engine/palette.cpp

2
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++;

Loading…
Cancel
Save