Skip to content

Commit f69c0ec

Browse files
committed
Improve palette handling in STB backend
1 parent 3a1dc34 commit f69c0ec

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)