From 33d025d35aae6ada688f1d299cc7e74f148ab2aa Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 10 Jul 2023 11:35:04 -0700 Subject: [PATCH] Fixed loading 8-bit BMP exported by Gimp with RGB masks --- src/video/SDL_pixels.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 54a560112..90941fb69 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -309,14 +309,13 @@ Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint3 /* SDL defaults to MSB ordering */ return SDL_PIXELFORMAT_INDEX4MSB; case 8: - if (Rmask == 0) { - return SDL_PIXELFORMAT_INDEX8; - } if (Rmask == 0xE0 && Gmask == 0x1C && Bmask == 0x03 && Amask == 0x00) { return SDL_PIXELFORMAT_RGB332; + } else { + return SDL_PIXELFORMAT_INDEX8; } break; case 12: