#include "setup.h"
/*global variable*/
-int use_sound; /* handle sound on/off menu and command-line option */
-int use_music; /* handle music on/off menu and command-line option */
-int audio_device; /* != 0: available and initialized */
+bool use_sound; /* handle sound on/off menu and command-line option */
+bool use_music; /* handle music on/off menu and command-line option */
+bool audio_device; /* != 0: available and initialized */
int current_music;
char * soundfilenames[NUM_SOUNDS] = {
void close_audio( void )
{
- if (audio_device == YES) {
+ if (audio_device) {
Mix_UnregisterAllEffects( SOUND_LEFT_SPEAKER );
Mix_UnregisterAllEffects( SOUND_RIGHT_SPEAKER );
Mix_CloseAudio();
snd = Mix_LoadWAV(file.c_str());
/* printf message and abort if there is an initialized audio device */
- if ((snd == NULL) && (audio_device == YES))
+ if ((snd == NULL) && audio_device)
st_abort("Can't load", file);
return(snd);
sng = Mix_LoadMUS(file.c_str());
/* printf message and abort if there is an initialized audio device */
- if ((sng == NULL) && (audio_device == YES))
+ if ((sng == NULL) && audio_device)
st_abort("Can't load", file);
return (sng);
}
/* this won't call the function if the user has disabled sound
* either via menu or via command-line option
*/
- if ((use_sound == YES) && (audio_device == YES))
+ if (use_sound && audio_device)
{
Mix_PlayChannel( whichSpeaker, snd, 0);
int playing_music(void)
{
- if (use_music == YES)
+ if (use_music)
{
return Mix_PlayingMusic();
}
int halt_music(void)
{
- if ((use_music == YES) && (audio_device == YES))
+ if (use_music && audio_device)
{
return Mix_HaltMusic();
}
int play_music(Mix_Music *music, int loops)
{
- if ((use_music == YES) && (audio_device == YES))
+ if (use_music && audio_device)
{
DEBUG_MSG(__PRETTY_FUNCTION__);
return Mix_PlayMusic(music, loops);