X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=sound.c;fp=sound.c;h=e9008f1b0deefebbed5a882c34d9086d09001c11;hp=3f13e0edc7e996cba140a935503469497d6867a2;hb=232d1b5f32a2d72f4d3fe7326f942bb7887a7f40;hpb=f8a1bfd0744369a492554476fd8a57484c581a5b diff --git a/sound.c b/sound.c index 3f13e0e..e9008f1 100644 --- a/sound.c +++ b/sound.c @@ -1,4 +1,5 @@ #include "sound.h" +#include "config.h" extern int sound_flag, music_flag; @@ -40,9 +41,7 @@ init_sound() { // Return 1 if the sound is ready to roll, and 0 if not. int i; -#ifdef DEBUG - printf ("Initialise sound\n"); -#endif + debug(printf ("Initialise sound\n")); // Initialise output with SDL_mixer if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 4096) < 0) { @@ -50,14 +49,14 @@ init_sound() { return 0; } -#ifdef DEBUG - // What kind of sound did we get? Ah who cares. As long as it can play - // some basic bangs and simple music. - Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); - printf("Opened audio at %d Hz %d bit %s\n", audio_rate, - (audio_format&0xFF), - (audio_channels > 1) ? "stereo" : "mono"); -#endif + debug( + // What kind of sound did we get? Ah who cares. As long as it can play + // some basic bangs and simple music. + Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); + printf("Opened audio at %d Hz %d bit %s\n", audio_rate, + (audio_format&0xFF), + (audio_channels > 1) ? "stereo" : "mono"); + ) // Preload all the tunes into memory for (i=0; i