From: Michael Gernoth Date: Mon, 11 Feb 2008 20:07:37 +0000 (+0100) Subject: encapsulate sdl_mixer stuff in #ifdef WITH_SDL_MIXER X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/commitdiff_plain/6c2a32385728be100bce7c33aca3945ffc42ae4b?ds=sidebyside encapsulate sdl_mixer stuff in #ifdef WITH_SDL_MIXER --- diff --git a/src/sim/makefile b/src/sim/makefile index 85c2286..a28ac84 100644 --- a/src/sim/makefile +++ b/src/sim/makefile @@ -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) diff --git a/src/sim/w_sound.c b/src/sim/w_sound.c index bbe918a..1c11202 100644 --- a/src/sim/w_sound.c +++ b/src/sim/w_sound.c @@ -63,8 +63,11 @@ * 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" @@ -76,7 +79,11 @@ 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)