#include #include #include #include #include #include "args.h" #include "common.h" #include "config.h" #include "sound.h" static Mix_Music *music[NUM_TUNES]; static int music_volume[NUM_TUNES] = {128,128,128}; static Mix_Chunk *wav[NUM_SOUNDS]; int audio_rate; Uint16 audio_format; int audio_channels; char *add_data_path(char *); char *wav_file[] = { "booom.wav", "cboom.wav", "boom.wav", "bzboom.wav" }; char *tune_file[] = { "magic.mod", "getzznew.mod", "4est_fulla3s.mod" }; // Return 1 if the sound is ready to roll, and 0 if not. int init_sound() { int i; char *s; // Initialise output with SDL_mixer if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 4096) < 0) { fprintf(stderr, "Couldn't open SDL_mixer audio: %s\n", SDL_GetError()); return 0; } // Preload all the tunes into memory for (i=0; i