Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make sure we bump the palette version when we modify it.

  • Loading branch information
slouken committed Mar 24, 2013
1 parent 4d61b3d commit 6c05ebd566145eb1bcf9f56d3afc3d08e2b0e3bf
Showing with 8 additions and 0 deletions.
  1. +8 −0 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;
}

0 comments on commit 6c05ebd

Please sign in to comment.