Fixed bug 5037 - Regression 2.0.12 Alpha value of 0 on palette may become opaque
(see also bug 3827)
This commit is contained in:
1 parent
36d5845152
commit
838bbf1f7a
4 files changed
+60
-19
No files matched your search
@@ -1165,12 +1165,10 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)
|
||||
|
||||
/* If Palette contains alpha values, promotes to alpha format */
|
||||
if (fmt->palette) {
|
||||
for (i = 0; i < fmt->palette->ncolors; i++) {
|
||||
Uint8 alpha_value = fmt->palette->colors[i].a;
|
||||
if (alpha_value != 0 && alpha_value != SDL_ALPHA_OPAQUE) {
|
||||
needAlpha = SDL_TRUE;
|
||||
break;
|
||||
}
|
||||
SDL_bool is_opaque, has_alpha_channel;
|
||||
SDL_DetectPalette(fmt->palette, &is_opaque, &has_alpha_channel);
|
||||
if (!is_opaque) {
|
||||
needAlpha = SDL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user