diff options
author | Oliver Kiehl | 2002-11-17 18:44:33 +0000 |
---|---|---|
committer | Oliver Kiehl | 2002-11-17 18:44:33 +0000 |
commit | fd5f110269f4a28c75fff9485c3a63e4bb13d2fd (patch) | |
tree | 101aec57df1b44d47fc660e0d8e77dd5723ff3d6 | |
parent | 5da9c10dab7e38427ea8464d295fe63076ca44bc (diff) | |
download | scummvm-rg350-fd5f110269f4a28c75fff9485c3a63e4bb13d2fd.tar.gz scummvm-rg350-fd5f110269f4a28c75fff9485c3a63e4bb13d2fd.tar.bz2 scummvm-rg350-fd5f110269f4a28c75fff9485c3a63e4bb13d2fd.zip |
added the ability to pause effects (s) and ambient sound (b)
svn-id: r5593
-rw-r--r-- | simon/simon.cpp | 23 | ||||
-rw-r--r-- | simon/simon.h | 4 | ||||
-rw-r--r-- | simon/vga.cpp | 1 |
3 files changed, 25 insertions, 3 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index de26fc38c8..03dd39a826 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -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; diff --git a/simon/simon.h b/simon/simon.h index 992b47ece8..30c8cc9337 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -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; diff --git a/simon/vga.cpp b/simon/vga.cpp index a0c322842f..541c952d83 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -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() |