Skip to content

Commit 2485181

Browse files
committed
SDL: SDL_CreateTexture() was using the wrong pixel format for sprites.
We never noticed because it's only been used with 0xFFFFFFFF and 0x00000000 pixels so far, so the byte order didn't matter. :)
1 parent f058a01 commit 2485181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dirksimple_sdl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void DirkSimple_drawsprite(DirkSimple_Sprite *sprite, int sx, int sy, int sw, in
349349
}
350350

351351
if (texture == NULL) {
352-
texture = SDL_CreateTexture(GRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, sprite->width, sprite->height);
352+
texture = SDL_CreateTexture(GRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, sprite->width, sprite->height);
353353
if (!texture) {
354354
char what[128];
355355
SDL_snprintf(what, sizeof (what), "Failed to create texture for sprite '%s'", sprite->name);

0 commit comments

Comments
 (0)