Skip to content

Commit 071d724

Browse files
ankith26slouken
authored andcommitted
Improve palette handling in STB backend
1 parent 0e017d5 commit 071d724

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/IMG_stb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ SDL_Surface *IMG_LoadSTB_RW(SDL_RWops *src)
191191
SDL_FreeSurface(surface);
192192
surface = converted;
193193
} else if (has_colorkey) {
194+
/* remove redundant pixel alpha before setting colorkey */
195+
palette->colors[colorkey_index].a = SDL_ALPHA_OPAQUE;
194196
SDL_SetColorKey(surface, SDL_TRUE, colorkey_index);
195197
}
196198
}

0 commit comments

Comments
 (0)