whee. more on/off ajustment
This commit is contained in:
parent
44fab62e93
commit
3cd4353596
|
|
@ -96,8 +96,8 @@ INLINE bool AudioManager::get_loop(AudioSound* sound) {
|
|||
// in the universe and it constructs itself.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AudioManager::AudioManager(void) {
|
||||
_sfx_active = audio_sfx_active;
|
||||
_music_active = audio_music_active;
|
||||
_sfx_active = _hard_sfx_active = audio_sfx_active;
|
||||
_music_active = _hard_music_active = audio_music_active;
|
||||
_master_sfx_volume = audio_master_sfx_volume;
|
||||
_master_music_volume = audio_master_music_volume;
|
||||
}
|
||||
|
|
@ -164,7 +164,11 @@ INLINE bool AudioManager::get_all_sound_active(void) {
|
|||
// Description: turn on/off SFX
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AudioManager::set_sfx_active(bool f) {
|
||||
AudioManager::_sfx_active = f;
|
||||
if (f) {
|
||||
if (AudioManager::_hard_sfx_active)
|
||||
AudioManager::_sfx_active = f;
|
||||
} else
|
||||
AudioManager::_sfx_active = f;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -173,7 +177,11 @@ INLINE void AudioManager::set_sfx_active(bool f) {
|
|||
// Description: turn on/off music
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AudioManager::set_music_active(bool f) {
|
||||
AudioManager::_music_active = f;
|
||||
if (f) {
|
||||
if (AudioManager::_hard_music_active)
|
||||
AudioManager::_music_active = f;
|
||||
} else
|
||||
AudioManager::_music_active = f;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -193,3 +201,25 @@ INLINE bool AudioManager::get_sfx_active(void) {
|
|||
INLINE bool AudioManager::get_music_active(void) {
|
||||
return AudioManager::_music_active;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AudioManager::set_hard_sfx_active
|
||||
// Access: Public, Static
|
||||
// Description: set the hardware availability state for SFX
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AudioManager::set_hard_sfx_active(bool f) {
|
||||
AudioManager::_hard_sfx_active = f;
|
||||
if (!f)
|
||||
AudioManager::_sfx_active = f;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AudioManager::set_hard_music_active
|
||||
// Access: Public, Static
|
||||
// Description: set the hardware availability state for music
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AudioManager::set_hard_music_active(bool f) {
|
||||
AudioManager::_hard_music_active = f;
|
||||
if (!f)
|
||||
AudioManager::_music_active = f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ AudioManager::LoopSet* AudioManager::_loopset = (AudioManager::LoopSet*)0L;
|
|||
AudioManager::LoopSet* AudioManager::_loopcopy = (AudioManager::LoopSet*)0L;
|
||||
bool AudioManager::_sfx_active = false;
|
||||
bool AudioManager::_music_active = false;
|
||||
bool AudioManager::_hard_sfx_active = false;
|
||||
bool AudioManager::_hard_music_active = false;
|
||||
bool AudioManager::_master_volume_change = false;
|
||||
float AudioManager::_master_sfx_volume = 0.;
|
||||
float AudioManager::_master_music_volume = 0.;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ private:
|
|||
static LoopSet* _loopcopy;
|
||||
static bool _sfx_active;
|
||||
static bool _music_active;
|
||||
static bool _hard_sfx_active;
|
||||
static bool _hard_music_active;
|
||||
static float _master_sfx_volume;
|
||||
static float _master_music_volume;
|
||||
static bool _master_volume_change;
|
||||
|
|
@ -72,6 +74,9 @@ PUBLISHED:
|
|||
INLINE static void set_music_active(bool);
|
||||
INLINE static bool get_sfx_active(void);
|
||||
INLINE static bool get_music_active(void);
|
||||
public:
|
||||
INLINE static void set_hard_sfx_active(bool);
|
||||
INLINE static void set_hard_music_active(bool);
|
||||
};
|
||||
|
||||
#include "audio_manager.I"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ static IDirectSound* musicDirectSound = NULL;
|
|||
if (FAILED(_result)) { \
|
||||
audio_cat->error() << _msg << " at " << __FILE__ << ":" << __LINE__ \
|
||||
<< endl; \
|
||||
AudioManager::set_sfx_active(false); \
|
||||
AudioManager::set_hard_sfx_active(false); \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ static IDirectSound* musicDirectSound = NULL;
|
|||
if (FAILED(_result)) { \
|
||||
audio_cat->error() << _msg << " at " << __FILE__ << ":" << __LINE__ \
|
||||
<< endl; \
|
||||
AudioManager::set_music_active(false); \
|
||||
AudioManager::set_hard_music_active(false); \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue