rnd-20020424-1-src
[rocksndiamonds.git] / src / init.c
index e5a1738b4840f59a4b2cc3c31fac267cd4f40d71..eee87022ee3146e7e37a903467f5a88f41fec398 100644 (file)
@@ -157,19 +157,12 @@ void InitSound()
 
   OpenAudio();
 
-  for(i=0; i<NUM_SOUNDS; i++)
-  {
-    if (!LoadSound(sound_name[i]))
-    {
-      audio.sound_available = FALSE;
-      audio.loops_available = FALSE;
-      audio.sound_enabled = FALSE;
+  InitSoundList(NUM_SOUNDS);
 
-      return;
-    }
-  }
+  for(i=0; i<NUM_SOUNDS; i++)
+    LoadSoundToList(sound_name[i], i);
 
-  num_bg_loops = LoadMusic();
+  LoadCustomMusic();
 
   StartSoundserver();
 }
@@ -424,14 +417,14 @@ void ReloadCustomArtwork()
 
   if (artwork.sounds_set_current != artwork.snd_current->name)
   {
-    printf("reload sounds ...\n");
+    InitReloadSounds(artwork.snd_current->name);
 
     artwork.sounds_set_current = artwork.snd_current->name;
   }
 
   if (artwork.music_set_current != artwork.mus_current->name)
   {
-    printf("reload music ...\n");
+    InitReloadMusic(artwork.mus_current->name);
 
     artwork.music_set_current = artwork.mus_current->name;
   }
@@ -1600,8 +1593,9 @@ void CloseAllAndExit(int exit_value)
   int i;
 
   StopSounds();
-  FreeSounds(NUM_SOUNDS);
   CloseAudio();
+  FreeAllSounds();
+  FreeAllMusic();
 
   FreeTileClipmasks();
   for(i=0; i<NUM_BITMAPS; i++)