Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Make sure we bump the palette version when we modify it.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 24, 2013
1 parent 4d61b3d commit 6c05ebd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video/SDL_surface.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c05ebd

Please sign in to comment.