Skip to content

Commit

Permalink
fixed build for SDL 2.28 and below
Browse files Browse the repository at this point in the history
mariotaku committed Mar 24, 2024
1 parent fe604f0 commit 2c8f96d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/ui/launcher/coverloader.c
Original file line number Diff line number Diff line change
@@ -304,6 +304,13 @@ static bool coverloader_filecache_get(coverloader_req_t *req) {
}
// Indexed images needs to be converted to true color before scaling
if (decoded->format->palette != NULL) {
#if !SDL_VERSION_ATLEAST(2, 30, 0)
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_RGBX8888
#else
#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_XBGR8888
#endif
#endif
SDL_Surface *true_color = SDL_ConvertSurfaceFormat(decoded, SDL_PIXELFORMAT_RGBX32, 0);
SDL_FreeSurface(decoded);
if (true_color == NULL) {

0 comments on commit 2c8f96d

Please sign in to comment.