From a65956818f4fd07c27e2923b59971e608e74c701 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sat, 30 Nov 2013 14:28:50 +0100 Subject: [PATCH] Bitmap: Feed image extension into SDL2_image for faster loading --- src/bitmap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bitmap.cpp b/src/bitmap.cpp index cf10399..b61321e 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -210,8 +210,9 @@ struct BitmapPrivate Bitmap::Bitmap(const char *filename) { SDL_RWops ops; - shState->fileSystem().openRead(ops, filename, FileSystem::Image); - SDL_Surface *imgSurf = IMG_Load_RW(&ops, 1); + const char *extension; + shState->fileSystem().openRead(ops, filename, FileSystem::Image, false, &extension); + SDL_Surface *imgSurf = IMG_LoadTyped_RW(&ops, 1, extension); if (!imgSurf) throw Exception(Exception::SDLError, "SDL: %s", SDL_GetError());