diff options
author | Torbjörn Andersson | 2003-08-03 15:50:39 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-08-03 15:50:39 +0000 |
commit | 3e3366f52122d8bb49ab1f5f138019b942659af5 (patch) | |
tree | 951c340aa8fec977807d9780de666cbe2e0fbfbc /sky | |
parent | a78508af332748ebaa434f41c61837ff4abec359 (diff) | |
download | scummvm-rg350-3e3366f52122d8bb49ab1f5f138019b942659af5.tar.gz scummvm-rg350-3e3366f52122d8bb49ab1f5f138019b942659af5.tar.bz2 scummvm-rg350-3e3366f52122d8bb49ab1f5f138019b942659af5.zip |
Added "fast mode" (Ctrl-F/Ctrl-G) like the one we have for SCUMM and Simon.
It does not change the game speed setting, because the most likely use (I
think) is to toggle it on briefly, e.g. while travelling the walkways.
svn-id: r9434
Diffstat (limited to 'sky')
-rw-r--r-- | sky/sky.cpp | 20 | ||||
-rw-r--r-- | sky/sky.h | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/sky/sky.cpp b/sky/sky.cpp index cb0ba22b82..876872670c 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -93,6 +93,8 @@ SkyState::SkyState(GameDetector *detector, OSystem *syst) _floppyIntro = detector->_floppyIntro; + _fastMode = 0; + _system->init_size(320, 200); } @@ -202,7 +204,12 @@ void SkyState::go() { _lastSaveTime = _system->get_msecs(); while (1) { - delay(_systemVars.gameSpeed); + if (_fastMode & 2) + delay(0); + else if (_fastMode & 1) + delay(10); + else + delay(_systemVars.gameSpeed); if (_system->get_msecs() - _lastSaveTime > 5 * 60 * 1000) { if (_skyControl->loadSaveAllowed()) { @@ -404,6 +411,17 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp while (_system->poll_event(&event)) { switch (event.event_code) { case OSystem::EVENT_KEYDOWN: + if (event.kbd.flags == OSystem::KBD_CTRL) { + if (event.kbd.keycode == 'f') { + _fastMode ^= 1; + break; + } + if (event.kbd.keycode == 'g') { + _fastMode ^= 2; + break; + } + } + // Make sure backspace works right (this fixes a small issue on OS X) if (event.kbd.keycode == 8) _key_pressed = 8; @@ -106,6 +106,8 @@ public: static SystemVars _systemVars; protected: + byte _fastMode; + void logic_engine(); void delay(uint amount); void go(); |