X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Finit.c;h=df4099e162cedaa88202b97e56f9446deff7a692;hb=41e8d55b767c898f20c29a1b0b8d2ef8840be2f5;hp=17a1cbdbf3d4a2224e0886cbfd72c2c40e06bbd7;hpb=4337ea074a6962a576fc0e44d61d48ebc76fa6ae;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 17a1cbdb..df4099e1 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" @@ -23,7 +21,6 @@ #include "tape.h" #include "tools.h" #include "files.h" -#include "joystick.h" #include "network.h" #include "netserv.h" @@ -31,7 +28,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 +54,6 @@ void OpenAll(void) InitCounter(); InitSound(); - InitSoundServer(); InitJoysticks(); InitRND(NEW_RANDOMIZE); @@ -88,10 +83,7 @@ void InitPlayerInfo() local_player = &stored_player[0]; for (i=0; iconnected = TRUE; @@ -147,46 +139,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() @@ -197,10 +151,13 @@ void InitJoysticks() int i; - if (global_joystick_status == JOYSTICK_OFF) - return; + /* always start with reliable default values */ + joystick.status = JOYSTICK_NOT_AVAILABLE; + for (i=0; i