diff options
Diffstat (limited to 'engines/sword2/sword2.cpp')
-rw-r--r-- | engines/sword2/sword2.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 778dfb1ab5..544c55e00a 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -42,6 +42,8 @@ #include "sword2/screen.h" #include "sword2/sound.h" +#define FRAMES_PER_SECOND 12 + namespace Sword2 { struct GameSettings { @@ -175,6 +177,7 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { _graphicsLevelFudged = false; _gameCycle = 0; + _gameSpeed = 1; _quit = false; } @@ -227,6 +230,10 @@ void Sword2Engine::writeSettings() { ConfMan.flushToDisk(); } +int Sword2Engine::getFramesPerSecond() { + return _gameSpeed * FRAMES_PER_SECOND; +} + /** * The global script variables and player object should be kept open throughout * the game, so that they are never expelled by the resource manager. @@ -513,6 +520,14 @@ void Sword2Engine::parseInputEvents() { while (_system->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: + if (event.kbd.flags == OSystem::KBD_CTRL) { + if (event.kbd.keycode == 'f') { + if (_gameSpeed == 1) + _gameSpeed = 2; + else + _gameSpeed = 1; + } + } if (!(_inputEventFilter & RD_KEYDOWN)) { _keyboardEvent.pending = true; _keyboardEvent.repeat = now + 400; |