mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Make SDL_LoadBMP() work with 32-bit bitmaps from ImageMagick.
This commit is contained in:
parent
0e9c0855f5
commit
a91f1a1adc
@ -246,6 +246,16 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
||||
Gmask = SDL_ReadLE32(src);
|
||||
Bmask = SDL_ReadLE32(src);
|
||||
Amask = SDL_ReadLE32(src);
|
||||
|
||||
/* ImageMagick seems to put out bogus masks here. Pick a default. */
|
||||
if ((Rmask == 0xFFFFFF) && (Gmask == 0xFFFFFF) &&
|
||||
(Bmask == 0xFFFFFF) && (Amask == 0xFFFFFF) ) {
|
||||
Amask = 0xFF000000;
|
||||
Rmask = 0x00FF0000;
|
||||
Gmask = 0x0000FF00;
|
||||
Bmask = 0x000000FF;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user