]> git.zerfleddert.de Git - micropolis/commitdiff
encapsulate sdl_mixer stuff in #ifdef WITH_SDL_MIXER
authorMichael Gernoth <michael@gernoth.net>
Mon, 11 Feb 2008 20:07:37 +0000 (21:07 +0100)
committerMichael Gernoth <michael@gernoth.net>
Mon, 11 Feb 2008 20:07:37 +0000 (21:07 +0100)
src/sim/makefile
src/sim/w_sound.c

index 85c2286d0748339178e7d8bdcaa547b614647708..a28ac84e4f22f0843ae17cd9cc07caabd55e37b9 100644 (file)
@@ -17,7 +17,7 @@ OPTFLAGS = -O3
 #OPTFLAGS = -g
 
 #DEFINES = -DIS_LINUX -DCAM -DNET
-DEFINES = -DIS_LINUX -DNO_AIRCRASH
+DEFINES = -DIS_LINUX -DWITH_SDL_MIXER -DNO_AIRCRASH
 
 CFLAGS += $(OPTFLAGS) $(DEFINES)
 
index bbe918a11d81b19377dca28ac905548668b12ceb..1c112023a6f4fa8275cf40c89d989248f33eab18 100644 (file)
  * CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY
  * NOT APPLY TO YOU.
  */
+#ifdef WITH_SDL_MIXER
 #include "SDL.h"
 #include "SDL_mixer.h"
+#endif
+
 #include "sim.h"
 
 
 struct sound {
   char *id;
   char *file;
+#ifdef WITH_SDL_MIXER
   Mix_Chunk *wave;
+#else
+  void *wave;
+#endif
 };
 
 struct sound sounds[SIM_NSOUNDS] = {
@@ -129,10 +136,12 @@ struct sound sounds[SIM_NSOUNDS] = {
   { "Zone",            "zone.wav",             NULL }
 };
 
+static int SoundInitialized = 0;
+
+#ifdef WITH_SDL_MIXER
 /* Sound routines */
 
 
-int SoundInitialized = 0;
 Mix_Chunk *rumble;
 
 
@@ -257,6 +266,32 @@ StopBulldozer(void)
   Mix_HaltChannel(DOZER_CHANNEL);
 }
 
+#else /* WITH_SDL_MIXER */
+InitializeSound()
+{
+}
+
+ShutDownSound()
+{
+}
+
+MakeSound(char *channel, char *id)
+{
+}
+
+MakeSoundOn(SimView *view, char *channel, char *id)
+{
+}
+
+StartBulldozer(void)
+{
+}
+
+StopBulldozer(void)
+{
+}
+#endif
+
 
 /* XXX comefrom: doKeyEvent */
 SoundOff(void)
Impressum, Datenschutz