rnd-20010115-1-src
[rocksndiamonds.git] / src / init.c
index 17a1cbdbf3d4a2224e0886cbfd72c2c40e06bbd7..9af442484ca33df0fbcc39d9dda7ea3c3627a2df 100644 (file)
@@ -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 <signal.h>
-
 #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<NUM_BITMAPS; i++)
     FreeBitmap(pix[i]);
-
-  KeyboardAutoRepeatOn();
-
   CloseVideoDisplay();
 
   ClosePlatformDependantStuff();