aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/cruise_main.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2009-05-31 11:37:21 +0000
committerPaul Gilbert2009-05-31 11:37:21 +0000
commit555d4038cc053c0c914dd1cb56746066446a1386 (patch)
treec70331c16c750f21f3d4e168ac58bb0fe0e0736b /engines/cruise/cruise_main.cpp
parentf94025f482ae9231dad845fcaeb9f08a5ad37746 (diff)
downloadscummvm-rg350-555d4038cc053c0c914dd1cb56746066446a1386.tar.gz
scummvm-rg350-555d4038cc053c0c914dd1cb56746066446a1386.tar.bz2
scummvm-rg350-555d4038cc053c0c914dd1cb56746066446a1386.zip
Slowed down the game to match the original, and introduced the ability to alter game speed using the keypad +/- keys
svn-id: r41064
Diffstat (limited to 'engines/cruise/cruise_main.cpp')
-rw-r--r--engines/cruise/cruise_main.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 752c8ded50..03ee9a08c3 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1273,7 +1273,7 @@ bool checkInput(int16 *buttonPtr) {
return false;
}
-int processInput(void) {
+int CruiseEngine::processInput(void) {
int16 mouseX = 0;
int16 mouseY = 0;
int16 button = 0;
@@ -1351,6 +1351,18 @@ int processInput(void) {
return 0;
}
+ // Handle any changes in game speed
+ if (_speedFlag) {
+ if ((keyboardCode == Common::KEYCODE_KP_PLUS) && (_gameSpeed >= 30)) {
+ _gameSpeed -= 10;
+ keyboardCode = Common::KEYCODE_INVALID;
+ }
+ if ((keyboardCode == Common::KEYCODE_KP_MINUS) && (_gameSpeed <= 200)) {
+ _gameSpeed += 10;
+ keyboardCode = Common::KEYCODE_INVALID;
+ }
+ }
+
if (!userEnabled) {
return 0;
}
@@ -1735,7 +1747,7 @@ void CruiseEngine::mainLoop(void) {
if (!bFastMode) {
// Delay for the specified amount of time, but still respond to events
- while (currentTick < lastTick + GAME_FRAME_DELAY) {
+ while (currentTick < lastTick + _gameSpeed) {
g_system->delayMillis(10);
currentTick = g_system->getMillis();
@@ -1760,6 +1772,12 @@ void CruiseEngine::mainLoop(void) {
lastTick = g_system->getMillis();
+ // Handle switchover in game speed after intro
+ if (!_speedFlag && canLoadGameStateCurrently()) {
+ _speedFlag = true;
+ _gameSpeed = GAME_FRAME_DELAY_2;
+ }
+
// Handle the next frame
// frames++;