[Scummvm-cvs-logs] SF.net SVN: scummvm: [29265] scummvm/trunk/engines/cruise/cruise_main.cpp

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Sat Oct 27 18:10:50 CEST 2007


Revision: 29265
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29265&view=rev
Author:   yazoo
Date:     2007-10-27 09:10:50 -0700 (Sat, 27 Oct 2007)

Log Message:
-----------
Add fast forward mode

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cruise_main.cpp

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2007-10-27 11:42:17 UTC (rev 29264)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2007-10-27 16:10:50 UTC (rev 29265)
@@ -1178,7 +1178,9 @@
 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 @@
 		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 @@
 			 * 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 @@
 	 * 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 @@
 			 * Osystem_Delay(t_left-SLEEP_GRAN);
 			 * while (Osystem_GetTicks()<t_end){q++;}; */
 #endif
-			manageEvents(4);
+			manageEvents();
 
 		} while (!playerDontAskQuit && quitValue2 && quitValue != 7);
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list