diff options
author | Travis Howell | 2003-12-10 00:54:53 +0000 |
---|---|---|
committer | Travis Howell | 2003-12-10 00:54:53 +0000 |
commit | 2347409dd13a25f977cf639987ddf17d0604bbd6 (patch) | |
tree | a1b2640b827a46a27035c1c8712274bd60988e63 /simon | |
parent | bb760a5b735944794ae2d14f5b839bd98b290ca4 (diff) | |
download | scummvm-rg350-2347409dd13a25f977cf639987ddf17d0604bbd6.tar.gz scummvm-rg350-2347409dd13a25f977cf639987ddf17d0604bbd6.tar.bz2 scummvm-rg350-2347409dd13a25f977cf639987ddf17d0604bbd6.zip |
Add puase option for simon games.
svn-id: r11545
Diffstat (limited to 'simon')
-rw-r--r-- | simon/simon.cpp | 22 | ||||
-rw-r--r-- | simon/simon.h | 2 |
2 files changed, 21 insertions, 3 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index 3ac5afb424..e626af06ac 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -313,6 +313,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) _debugMode = 0; _debugLevel = 0; _language = 0; + _pause = 0; _start_mainscript = 0; _continous_mainscript = 0; _continous_vgascript = 0; @@ -3447,6 +3448,9 @@ void SimonEngine::processSpecialKeys() { if (_game & GF_SIMON2) _exit_cutscene = true; break; + case 'p': + pause(); + break; case 't': if ((_game & GF_SIMON2 && _game & GF_TALKIE) || ( _game & GF_TALKIE && _language > 1)) if (_speech) @@ -3495,6 +3499,18 @@ void SimonEngine::processSpecialKeys() { _key_pressed = 0; } +void SimonEngine::pause() { + _key_pressed = 0; + _pause = 1; + for (;;) { + delay(1); + if (_key_pressed == 'p') + goto get_out; + } +get_out:; + _pause = 0; +} + #ifdef __PALM_OS__ static const byte *_simon1_cursor; #else @@ -4741,7 +4757,7 @@ void SimonEngine::delay(uint amount) { uint32 start = _system->get_msecs(); uint32 cur = start; - uint vga_period; + uint this_delay, vga_period; if (_fast_mode) vga_period = 10; @@ -4753,7 +4769,7 @@ void SimonEngine::delay(uint amount) { _rnd.getRandomNumber(2); do { - while (!_in_callback && cur >= _last_vga_tick + vga_period) { + while (!_in_callback && cur >= _last_vga_tick + vga_period && !_pause) { _last_vga_tick += vga_period; // don't get too many frames behind @@ -4808,7 +4824,7 @@ void SimonEngine::delay(uint amount) { break; { - uint this_delay = _fast_mode ? 1 : 20; + this_delay = _fast_mode ? 1 : 20; if (this_delay > amount) this_delay = amount; _system->delay_msecs(this_delay); diff --git a/simon/simon.h b/simon/simon.h index 032f502aef..198cf5752b 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -192,6 +192,7 @@ protected: uint16 _debugMode; uint16 _language; + bool _pause; bool _start_mainscript; bool _continous_mainscript; bool _continous_vgascript; @@ -778,6 +779,7 @@ protected: void loadMusic(uint music); void checkTimerCallback(); void delay(uint delay); + void pause(); void o_83_helper(); void o_190_helper(uint i); |