X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=3e9c7112da72c573e71c8d75ae047e137dc97a24;hb=681721dddc91bcdaef50002d1e861cc8d484e938;hp=e038f03aa44d0f142dc1f5b4e32e884207627df2;hpb=e5a881dc01d1533761aa8d6d0c41ed4a4bd5bbd0;p=rocksndiamonds.git diff --git a/src/libgame/sound.c b/src/libgame/sound.c index e038f03a..3e9c7112 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -1,7 +1,7 @@ /*********************************************************** * Artsoft Retro-Game Library * *----------------------------------------------------------* -* (c) 1994-2000 Artsoft Entertainment * +* (c) 1994-2001 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -181,6 +181,9 @@ void InitPlaylist(void) void StartSoundserver(void) { + if (!audio.sound_available) + return; + #if defined(PLATFORM_UNIX) && !defined(TARGET_SDL) if (!ForkAudioProcess()) audio.sound_available = FALSE; @@ -873,6 +876,9 @@ static boolean LoadSoundExt(char *sound_name, boolean is_music) int i; #endif + if (!audio.sound_available) + return FALSE; + num_sounds++; Sound = checked_realloc(Sound, num_sounds * sizeof(struct SampleInfo)); @@ -1000,6 +1006,9 @@ int LoadMusic(void) int num_wav_music = 0; int num_mod_music = 0; + if (!audio.sound_available) + return 0; + if ((dir = opendir(music_directory)) == NULL) { Error(ERR_WARN, "cannot read music directory '%s'", music_directory); @@ -1128,6 +1137,9 @@ void PlaySoundExt(int nr, int volume, int stereo, boolean loop) void FadeMusic(void) { #if defined(TARGET_SDL) + if (!audio.sound_available) + return; + if (audio.mods_available) Mix_FadeOutMusic(SOUND_FADING_INTERVAL); else