hack for 32 bit bmp files
This commit is contained in:
parent
5d01fa885f
commit
1a4169cf6a
|
@ -573,9 +573,17 @@ static img_t _gfx_load_image(char *filename)
|
|||
}
|
||||
img = IMG_Load(filename);
|
||||
if (!img) {
|
||||
|
||||
return NULL;
|
||||
}
|
||||
if (img->format->BitsPerPixel == 32) { /* hack for 32 bit BMP :( */
|
||||
SDL_RWops *rwop;
|
||||
rwop = SDL_RWFromFile(filename, "rb");
|
||||
if (rwop) {
|
||||
if (IMG_isBMP(rwop))
|
||||
SDL_SetAlpha(img, SDL_RLEACCEL, SDL_ALPHA_OPAQUE);
|
||||
SDL_FreeRW(rwop);
|
||||
}
|
||||
}
|
||||
return img;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue