Fixed loading 8-bit BMP exported by Gimp with RGB masks

main
Sam Lantinga 2023-07-10 11:35:04 -07:00
parent 1e50823a14
commit 33d025d35a
1 changed files with 2 additions and 3 deletions

View File

@ -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: