From 8718681e490d3d93bed10661051a7a441a65cbb7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 24 Mar 2013 10:37:16 -0700 Subject: [PATCH] Make sure we bump the palette version when we modify it. --- src/video/SDL_surface.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 93fbdc8d7..4c67dc916 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -189,10 +189,18 @@ SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) surface->map->info.colorkey = key; if (surface->format->palette) { surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_TRANSPARENT; + ++surface->format->palette->version; + if (!surface->format->palette->version) { + surface->format->palette->version = 1; + } } } else { if (surface->format->palette) { surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_OPAQUE; + ++surface->format->palette->version; + if (!surface->format->palette->version) { + surface->format->palette->version = 1; + } } surface->map->info.flags &= ~SDL_COPY_COLORKEY; }