mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Only set colorkey, if converted surface has no alpha channel (2979)
This commit is contained in:
parent
f6197aec85
commit
db4246f695
@ -1116,9 +1116,13 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format,
|
|||||||
/* The palette is identical, just set the same colorkey */
|
/* The palette is identical, just set the same colorkey */
|
||||||
SDL_SetColorKey(convert, 1, surface->map->info.colorkey);
|
SDL_SetColorKey(convert, 1, surface->map->info.colorkey);
|
||||||
} else if (!format->palette) {
|
} else if (!format->palette) {
|
||||||
set_colorkey_by_color = SDL_TRUE;
|
if (format->Amask) {
|
||||||
/* Was done by 'palette_ck_transform' */
|
/* No need to add the colorkey, transparency is in the alpha channel*/
|
||||||
convert_colorkey = SDL_FALSE;
|
} else {
|
||||||
|
/* Only set the colorkey information */
|
||||||
|
set_colorkey_by_color = SDL_TRUE;
|
||||||
|
convert_colorkey = SDL_FALSE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
set_colorkey_by_color = SDL_TRUE;
|
set_colorkey_by_color = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user