mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
surface: Make sure SDL_ConvertSurface() deals with palettes (thanks, Sylvain!).
Fixes Bugzilla #3826. Fixes Bugzilla #2979.
This commit is contained in:
@@ -998,6 +998,11 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format,
|
||||
surface->format->Gmask, surface->format->Bmask,
|
||||
surface->format->Amask);
|
||||
|
||||
/* Share the palette, if any */
|
||||
if (surface->format->palette) {
|
||||
SDL_SetSurfacePalette(tmp, surface->format->palette);
|
||||
}
|
||||
|
||||
SDL_FillRect(tmp, NULL, surface->map->info.colorkey);
|
||||
|
||||
tmp->map->info.flags &= ~SDL_COPY_COLORKEY;
|
||||
|
Reference in New Issue
Block a user