#endif
}
+static void ReloadCustomSounds()
+{
+ int i;
+
+ printf("DEBUG: reloading sounds '%s' [%d] ...\n",
+ artwork.sounds_set_current, audio.soundserver_pid);
+
+#if 1
+ FreeAllSounds();
+
+ InitSoundList(NUM_SOUNDS);
+ for(i=0; i<NUM_SOUNDS; i++)
+ LoadSoundToList(sound_name[i], i);
+#endif
+}
+
+static void ReloadCustomMusic()
+{
+ printf("DEBUG: reloading music '%s' [%d] ...\n",
+ artwork.music_set_current, audio.soundserver_pid);
+
+#if 1
+ FreeAllMusic();
+
+ LoadCustomMusic();
+#endif
+}
+
void InitSound()
{
int i;
OpenAudio();
+ SetAudioReloadFunctions(ReloadCustomSounds, ReloadCustomMusic);
- for(i=0; i<NUM_SOUNDS; i++)
- {
- if (!LoadSound(sound_name[i]))
- {
- audio.sound_available = FALSE;
- audio.loops_available = FALSE;
- audio.sound_enabled = FALSE;
+#if 1
+ InitSoundList(NUM_SOUNDS);
- return;
- }
- }
+ for(i=0; i<NUM_SOUNDS; i++)
+ LoadSoundToList(sound_name[i], i);
- num_bg_loops = LoadMusic();
+ LoadCustomMusic();
+#endif
StartSoundserver();
+
+#if 0
+ InitReloadSounds(artwork.snd_current->name);
+ InitReloadMusic(artwork.mus_current->name);
+#endif
}
void InitTileClipmasks()
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;
}
int i;
StopSounds();
- FreeSounds(NUM_SOUNDS);
CloseAudio();
+ FreeAllSounds();
+ FreeAllMusic();
FreeTileClipmasks();
for(i=0; i<NUM_BITMAPS; i++)