Bitmap: Feed image extension into SDL2_image for faster loading
This commit is contained in:
parent
64f35071ab
commit
a65956818f
|
@ -210,8 +210,9 @@ struct BitmapPrivate
|
||||||
Bitmap::Bitmap(const char *filename)
|
Bitmap::Bitmap(const char *filename)
|
||||||
{
|
{
|
||||||
SDL_RWops ops;
|
SDL_RWops ops;
|
||||||
shState->fileSystem().openRead(ops, filename, FileSystem::Image);
|
const char *extension;
|
||||||
SDL_Surface *imgSurf = IMG_Load_RW(&ops, 1);
|
shState->fileSystem().openRead(ops, filename, FileSystem::Image, false, &extension);
|
||||||
|
SDL_Surface *imgSurf = IMG_LoadTyped_RW(&ops, 1, extension);
|
||||||
|
|
||||||
if (!imgSurf)
|
if (!imgSurf)
|
||||||
throw Exception(Exception::SDLError, "SDL: %s", SDL_GetError());
|
throw Exception(Exception::SDLError, "SDL: %s", SDL_GetError());
|
||||||
|
|
Loading…
Reference in New Issue