added the ability to pause effects (s) and ambient sound (b)

svn-id: r5593
This commit is contained in:
Oliver Kiehl 2002-11-17 18:44:33 +00:00
parent 5da9c10dab
commit fd5f110269
3 changed files with 25 additions and 3 deletions

View File

@ -154,7 +154,9 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst)
_voice_sound = 0;
_ambient_sound = 0;
_music_playing = false;
_effects_paused = false;
_ambient_paused = false;
_music_paused = false;
}
SimonState::~SimonState()
@ -4615,7 +4617,18 @@ void SimonState::delay(uint amount)
} else if (event.kbd.keycode == '-') {
midi.set_volume(midi.get_volume() - 10);
} else if (event.kbd.keycode == 'm') {
midi.pause(_music_playing ^= 1);
midi.pause(_music_paused ^= 1);
} else if (event.kbd.keycode == 's') {
_effects_paused ^= 1;
} else if (event.kbd.keycode == 'b') {
_ambient_paused ^= 1;
if (_ambient_paused && _ambient_playing) {
_mixer->stop(_ambient_index);
} else if (_ambient_playing) {
uint tmp = _ambient_playing;
_ambient_playing = 0;
playAmbient(tmp);
}
} else if (event.kbd.flags == OSystem::KBD_CTRL) {
if (event.kbd.keycode == 'f') {
_fast_mode ^= 1;
@ -5140,6 +5153,9 @@ void SimonState::playEffects(uint sound)
if (_effects_offsets == NULL)
return;
if (_effects_paused)
return;
if (_game == GAME_SIMON1TALKIE) { /* simon 1 talkie */
#ifdef USE_MAD
if (_effects_type == FORMAT_MP3) {
@ -5166,6 +5182,9 @@ void SimonState::playAmbient(uint sound)
if (_effects_offsets == NULL)
return;
if (_ambient_paused)
return;
if (sound == _ambient_playing)
return;

View File

@ -341,7 +341,9 @@ public:
int _ambient_index;
uint _ambient_playing;
bool _music_playing;
bool _effects_paused;
bool _ambient_paused;
bool _music_paused;
int _timer_id;

View File

@ -1345,6 +1345,7 @@ void SimonState::vc_28()
void SimonState::vc_29_stop_all_sounds()
{
_mixer->stopAll();
_ambient_playing = 0;
}
void SimonState::vc_30_set_base_delay()