rnd-20001204-1-src
[rocksndiamonds.git] / src / libgame / system.c
index 0304be812529fa19b895a5eb9d59bbd11e3db7bb..eff8576cf417ccf793b11304a209ebe58cf32b80 100644 (file)
@@ -1,15 +1,14 @@
 /***********************************************************
-*  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
+* Artsoft Retro-Game Library                               *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+* (c) 1994-2000 Artsoft Entertainment                      *
+*               Holger Schemel                             *
+*               Detmolder Strasse 189                      *
+*               33604 Bielefeld                            *
+*               Germany                                    *
+*               e-mail: info@artsoft.org                   *
 *----------------------------------------------------------*
-*  system.c                                                *
+* system.c                                                 *
 ***********************************************************/
 
 #include <string.h>
 #include <fcntl.h>
 #endif
 
-#include "libgame.h"
+#include "system.h"
+#include "sound.h"
+#include "misc.h"
+
 
-#if 0
 /* ========================================================================= */
 /* exported variables                                                        */
 /* ========================================================================= */
@@ -33,6 +34,9 @@ struct VideoSystemInfo        video;
 struct AudioSystemInfo audio;
 struct GfxInfo         gfx;
 
+struct LevelDirInfo    *leveldir_first = NULL;
+struct LevelDirInfo    *leveldir_current = NULL;
+
 Display        *display = NULL;
 Visual        *visual = NULL;
 int            screen = 0;
@@ -50,7 +54,6 @@ int           redraw_tiles = 0;
 
 int            FrameCounter = 0;
 
-#endif
 
 /* ========================================================================= */
 /* init functions                                                            */
@@ -431,6 +434,7 @@ inline boolean OpenAudio(struct AudioSystemInfo *audio)
 {
   audio->sound_available = FALSE;
   audio->loops_available = FALSE;
+  audio->sound_enabled = FALSE;
   audio->soundserver_pipe[0] = audio->soundserver_pipe[1] = 0;
   audio->soundserver_pid = 0;
   audio->device_name = NULL;
@@ -441,12 +445,14 @@ inline boolean OpenAudio(struct AudioSystemInfo *audio)
   {
     audio->sound_available = TRUE;
     audio->loops_available = TRUE;
+    audio->sound_enabled = TRUE;
   }
 #elif defined(PLATFORM_MSDOS)
   if (MSDOSOpenAudio())
   {
     audio->sound_available = TRUE;
     audio->loops_available = TRUE;
+    audio->sound_enabled = TRUE;
   }
 #elif defined(PLATFORM_UNIX)
   UnixOpenAudio(audio);
@@ -467,6 +473,15 @@ inline void CloseAudio(struct AudioSystemInfo *audio)
 
   audio->sound_available = FALSE;
   audio->loops_available = FALSE;
+  audio->sound_enabled = FALSE;
+}
+
+inline void SetAudioMode(boolean enabled)
+{
+  if (!audio.sound_available)
+    return;
+
+  audio.sound_enabled = enabled;
 }