Bitmap: Supply image filename on loading error

This commit is contained in:
Jonas Kulla 2014-01-05 10:28:35 +01:00
parent 8ed6de22a4
commit 19dc83a5d5
1 changed files with 2 additions and 1 deletions

View File

@ -212,7 +212,8 @@ Bitmap::Bitmap(const char *filename)
SDL_Surface *imgSurf = IMG_LoadTyped_RW(&ops, 1, 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, "Error loading image '%s': %s",
filename, SDL_GetError());
p->ensureFormat(imgSurf, SDL_PIXELFORMAT_ABGR8888); p->ensureFormat(imgSurf, SDL_PIXELFORMAT_ABGR8888);