[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.83,1.84 simon.h,1.16,1.17 vga.cpp,1.6,1.7
Oliver Kiehl
olki at users.sourceforge.net
Sun Nov 17 10:45:03 CET 2002
Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv12084
Modified Files:
simon.cpp simon.h vga.cpp
Log Message:
added the ability to pause effects (s) and ambient sound (b)
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- simon.cpp 17 Nov 2002 17:15:29 -0000 1.83
+++ simon.cpp 17 Nov 2002 18:44:33 -0000 1.84
@@ -154,7 +154,9 @@
_voice_sound = 0;
_ambient_sound = 0;
- _music_playing = false;
+ _effects_paused = false;
+ _ambient_paused = false;
+ _music_paused = false;
}
SimonState::~SimonState()
@@ -4615,7 +4617,18 @@
} 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 @@
if (_effects_offsets == NULL)
return;
+ if (_effects_paused)
+ return;
+
if (_game == GAME_SIMON1TALKIE) { /* simon 1 talkie */
#ifdef USE_MAD
if (_effects_type == FORMAT_MP3) {
@@ -5164,6 +5180,9 @@
void SimonState::playAmbient(uint sound)
{
if (_effects_offsets == NULL)
+ return;
+
+ if (_ambient_paused)
return;
if (sound == _ambient_playing)
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- simon.h 17 Nov 2002 17:15:29 -0000 1.16
+++ simon.h 17 Nov 2002 18:44:33 -0000 1.17
@@ -341,7 +341,9 @@
int _ambient_index;
uint _ambient_playing;
- bool _music_playing;
+ bool _effects_paused;
+ bool _ambient_paused;
+ bool _music_paused;
int _timer_id;
Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- vga.cpp 13 Nov 2002 16:34:22 -0000 1.6
+++ vga.cpp 17 Nov 2002 18:44:33 -0000 1.7
@@ -1345,6 +1345,7 @@
void SimonState::vc_29_stop_all_sounds()
{
_mixer->stopAll();
+ _ambient_playing = 0;
}
void SimonState::vc_30_set_base_delay()
More information about the Scummvm-git-logs
mailing list