aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorVincent Hamm2007-10-27 16:10:50 +0000
committerVincent Hamm2007-10-27 16:10:50 +0000
commit102764da6e86e261bce755c10b5289c2c9c5343a (patch)
tree8870ad4bb1e6760b6a96db2d6741bf7ebac73bd8 /engines/cruise
parentb225f01d14f87f8bb2f10209fdc82811a9c2ea96 (diff)
downloadscummvm-rg350-102764da6e86e261bce755c10b5289c2c9c5343a.tar.gz
scummvm-rg350-102764da6e86e261bce755c10b5289c2c9c5343a.tar.bz2
scummvm-rg350-102764da6e86e261bce755c10b5289c2c9c5343a.zip
Add fast forward mode
svn-id: r29265
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/cruise_main.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 1a89b5671e..202504a297 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1178,7 +1178,9 @@ int processInput(void) {
int oldMouseX;
int oldMouseY;
-void manageEvents(int count) {
+bool bFastMode = false;
+
+void manageEvents() {
Common::Event event;
Common::EventManager * eventMan = g_system->getEventManager();
@@ -1195,7 +1197,8 @@ void manageEvents(int count) {
case Common::EVENT_QUIT:
g_system->quit();
break;
- /* case Common::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
+ /*
* switch (event.kbd.keycode) {
* case '\n':
* case '\r':
@@ -1261,6 +1264,18 @@ void manageEvents(int count) {
* break;
* }
* break; */
+ if (event.kbd.flags == Common::KBD_CTRL)
+ {
+ if (event.kbd.keycode == Common::KEYCODE_d)
+ {
+ // enable debugging stuff ?
+ }
+ else if (event.kbd.keycode == Common::KEYCODE_f)
+ {
+ bFastMode = !bFastMode;
+ }
+ }
+
default:
break;
}
@@ -1273,18 +1288,11 @@ void manageEvents(int count) {
* mouseRight = 0;
* }
*/
- int i;
+ g_system->updateScreen();
- for (i = 0; i < count; i++) {
- //FIXME(?): Maybe there's a better way to "fix" this?
- //
- //Since not all backends/ports can update the screen
- //100 times per second, only update the screen every
- //other frame (1000 / 2 * 10 i.e. 50 times per second max.)
- if (i % 2)
- g_system->updateScreen();
- g_system->delayMillis(10);
- manageEvents(0);
+ if(!bFastMode)
+ {
+ g_system->delayMillis(40);
}
}
@@ -1427,7 +1435,7 @@ void mainLoop(void) {
* Osystem_Delay(t_left-SLEEP_GRAN);
* while (Osystem_GetTicks()<t_end){q++;}; */
#endif
- manageEvents(4);
+ manageEvents();
} while (!playerDontAskQuit && quitValue2 && quitValue != 7);
}