mirror of
https://github.com/yawut/SDL.git
synced 2026-07-31 15:37:17 -05:00
Make sure we bump the palette version when we modify it.
This commit is contained in:
parent
4d92e1780f
commit
0feed45f5c
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user