From: Holger Schemel Date: Tue, 10 Dec 2019 22:52:33 +0000 (+0100) Subject: improved error messages when IMG_Load() fails loading an image X-Git-Tag: 4.1.4.0~6 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=368d771258ee3aed9c0713a0998094651eca2504 improved error messages when IMG_Load() fails loading an image If loading an image using "IMG_Load()" fails, the name of the file is now also displayed with the error message. This already worked in the past, but was broken since commit a2698b3b. --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 1184acd8..7fb650f1 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -273,7 +273,7 @@ static void SDLSetWindowIcon(char *basename) if ((surface = IMG_Load(filename)) == NULL) { - Error(ERR_WARN, "IMG_Load() failed: %s", SDL_GetError()); + Error(ERR_WARN, "IMG_Load('%s') failed: %s", basename, SDL_GetError()); return; } @@ -2239,7 +2239,8 @@ Bitmap *SDLLoadImage(char *filename) // load image to temporary surface if ((sdl_image_tmp = IMG_Load(filename)) == NULL) - Error(ERR_EXIT, "IMG_Load() failed: %s", SDL_GetError()); + Error(ERR_EXIT, "IMG_Load('%s') failed: %s", getBaseNamePtr(filename), + SDL_GetError()); print_timestamp_time("IMG_Load");