fixed bug where player actions were incorrectly mapped in single player mode (also...
[rocksndiamonds.git] / src / libgame / sound.c
index 591ea7d444ce3ecbe416fe96cbcc2b39c5a03ef6..4af58b671dd45294c2bc1b0a35ab6f54a246bd1b 100644 (file)
@@ -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;
   }
@@ -598,7 +598,6 @@ void LoadCustomMusic_NoConf(void)
   while ((dir_entry = readDirectory(dir)) != NULL)     /* loop all entries */
   {
     char *basename = dir_entry->basename;
-    char *filename = NULL;
     MusicInfo *mus_info = NULL;
     boolean music_already_used = FALSE;
     int i;
@@ -621,12 +620,8 @@ void LoadCustomMusic_NoConf(void)
     if (draw_init_text)
       DrawInitText(basename, 150, FC_YELLOW);
 
-    filename = getPath2(music_directory, basename);
-
-    if (FileIsMusic(basename))
-      mus_info = Load_WAV_or_MOD(filename);
-
-    free(filename);
+    if (FileIsMusic(dir_entry->filename))
+      mus_info = Load_WAV_or_MOD(dir_entry->filename);
 
     if (mus_info)
     {