JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Some code cleanup.
[vor.git] / sound.c
diff --git a/sound.c b/sound.c
index 0b8a046..7cf5486 100644 (file)
--- a/sound.c
+++ b/sound.c
@@ -1,8 +1,6 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <SDL/SDL.h>
-#include <SDL/SDL_mixer.h>
+#include "sound.h"
+
+extern int sound_flag, music_flag;
 
 #define CONDERROR(a) if ((a)) {fprintf(stderr,"Error: %s\n",SDL_GetError());exit(1);}
 #define NULLERROR(a) CONDERROR((a)==NULL)
@@ -76,6 +74,7 @@ int init_sound() {/*{{{*/
 }/*}}}*/
 
 void play_sound(int i)  {/*{{{*/
+       if(!sound_flag) return;
 #ifdef DEBUG
     printf ("play sound %d on first free channel\n",i);
 #endif
@@ -88,6 +87,7 @@ int playing=-1;
 #undef DEBUG
 
 void play_tune(int i) {/*{{{*/
+       if(!sound_flag || !music_flag) return;
     if (playing==i)
        return;
     if (playing) {