Skip to content

Commit 015cc6a

Browse files
committed
Fixed accidentally using INDEX8 textures for RGB24 surfaces
1 parent 7a49ce7 commit 015cc6a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/render/SDL_render.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,8 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s
18461846

18471847
for (i = 0; i < renderer->num_texture_formats; ++i) {
18481848
if (!SDL_ISPIXELFORMAT_FOURCC(renderer->texture_formats[i]) &&
1849-
SDL_ISPIXELFORMAT_ALPHA(renderer->texture_formats[i]) == needAlpha) {
1849+
SDL_ISPIXELFORMAT_ALPHA(renderer->texture_formats[i]) == needAlpha &&
1850+
SDL_ISPIXELFORMAT_INDEXED(renderer->texture_formats[i]) == SDL_ISPIXELFORMAT_INDEXED(surface->format)) {
18501851
format = renderer->texture_formats[i];
18511852
break;
18521853
}

0 commit comments

Comments
 (0)