From: Holger Schemel Date: Tue, 28 Jul 2015 16:37:53 +0000 (+0200) Subject: improved error messages when loading artwork fails X-Git-Tag: 4.0.0.0-rc1~161 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9cacff9f1079f93be93a5054042a1bd3eba6de65;p=rocksndiamonds.git improved error messages when loading artwork fails --- diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 5ace5922..4af58b67 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -516,7 +516,7 @@ static void *Load_WAV(char *filename) if ((snd_info->data_ptr = Mix_LoadWAV(filename)) == NULL) { - Error(ERR_WARN, "cannot read sound file '%s'", filename); + Error(ERR_WARN, "cannot read sound file '%s': %s", filename, Mix_GetError()); free(snd_info); return NULL; } @@ -540,7 +540,7 @@ static void *Load_MOD(char *filename) if ((mod_info->data_ptr = Mix_LoadMUS(filename)) == NULL) { - Error(ERR_WARN, "cannot read music file '%s'", filename); + Error(ERR_WARN, "cannot read music file '%s': %s", filename, Mix_GetError()); free(mod_info); return NULL; } diff --git a/src/libgame/system.c b/src/libgame/system.c index 2efe6dd9..85553281 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -851,7 +851,7 @@ Bitmap *LoadCustomImage(char *basename) Error(ERR_EXIT, "LoadCustomImage(): cannot find file '%s'", basename); if ((new_bitmap = LoadImage(filename)) == NULL) - Error(ERR_EXIT, "LoadImage() failed: %s", GetError()); + Error(ERR_EXIT, "LoadImage('%s') failed: %s", basename, GetError()); return new_bitmap; } @@ -878,7 +878,7 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename) if ((new_bitmap = LoadImage(filename)) == NULL) { - Error(ERR_WARN, "LoadImage() failed: %s", GetError()); + Error(ERR_WARN, "LoadImage('%s') failed: %s", basename, GetError()); return; }