X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=9af442484ca33df0fbcc39d9dda7ea3c3627a2df;hb=681721dddc91bcdaef50002d1e861cc8d484e938;hp=17a1cbdbf3d4a2224e0886cbfd72c2c40e06bbd7;hpb=4337ea074a6962a576fc0e44d61d48ebc76fa6ae;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 17a1cbdb..9af44248 100644 --- a/src/init.c +++ b/src/init.c @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2000 Artsoft Entertainment * +* (c) 1995-2001 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -11,8 +11,6 @@ * init.c * ***********************************************************/ -#include - #include "libgame/libgame.h" #include "init.h" @@ -31,7 +29,6 @@ static void InitPlayerInfo(void); static void InitLevelInfo(void); static void InitNetworkServer(void); static void InitSound(void); -static void InitSoundServer(void); static void InitGfx(void); static void InitGfxBackground(void); static void InitGadgets(void); @@ -58,7 +55,6 @@ void OpenAll(void) InitCounter(); InitSound(); - InitSoundServer(); InitJoysticks(); InitRND(NEW_RANDOMIZE); @@ -147,46 +143,8 @@ void InitSound() } num_bg_loops = LoadMusic(); -} - -void InitSoundServer() -{ - if (!audio.sound_available) - return; - -#if !defined(TARGET_SDL) -#if defined(PLATFORM_UNIX) - - if (pipe(audio.soundserver_pipe) < 0) - { - Error(ERR_WARN, "cannot create pipe - no sounds"); - audio.sound_available = FALSE; - return; - } - - if ((audio.soundserver_pid = fork()) < 0) - { - Error(ERR_WARN, "cannot create sound server process - no sounds"); - audio.sound_available = FALSE; - return; - } - - if (audio.soundserver_pid == 0) /* we are child */ - { - SoundServer(); - - /* never reached */ - exit(0); - } - else /* we are parent */ - close(audio.soundserver_pipe[0]); /* no reading from pipe needed */ - -#else /* !PLATFORM_UNIX */ - SoundServer(); - -#endif /* !PLATFORM_UNIX */ -#endif /* !TARGET_SDL */ + StartSoundserver(); } void InitJoysticks() @@ -491,7 +449,7 @@ void InitGfx() src_x, src_y, TILEX, TILEY, 0, 0); } } -#endif /* TARGET_X11_ANTIVE */ +#endif /* TARGET_X11_NATIVE */ #endif /* TARGET_X11 */ } @@ -1677,17 +1635,10 @@ void CloseAllAndExit(int exit_value) StopSounds(); FreeSounds(NUM_SOUNDS); - -#if !defined(TARGET_SDL) - if (audio.soundserver_pid) - kill(audio.soundserver_pid, SIGTERM); -#endif + CloseAudio(); for(i=0; i