summaryrefslogtreecommitdiff
path: root/src/video/sdl2_v.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-11 09:35:42 +0100
committerPatric Stout <github@truebrain.nl>2021-02-11 20:23:53 +0100
commit569ce6c7b43be52911d1a56ed43b890f5cc2d765 (patch)
tree32ec77d986f82d9838da2dc96f67abebe5f42097 /src/video/sdl2_v.cpp
parent64e2d6b6720ae16ba17a6b730e0319d267e07756 (diff)
downloadopenttd-569ce6c7b43be52911d1a56ed43b890f5cc2d765.tar.xz
Fix 30e69c51: palette was not marked dirty when creating a new
This means the code depended that the caller did this for us before MakePalette() is executed, which is neither a requirement nor a promise the code makes.
Diffstat (limited to 'src/video/sdl2_v.cpp')
-rw-r--r--src/video/sdl2_v.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index fd6cf6c11..e24b31db5 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -95,6 +95,8 @@ static void MakePalette()
if (_sdl_palette == nullptr) usererror("SDL2: Couldn't allocate palette: %s", SDL_GetError());
}
+ _cur_palette.first_dirty = 0;
+ _cur_palette.count_dirty = 256;
_local_palette = _cur_palette;
UpdatePalette();