[Scummvm-cvs-logs] SF.net SVN: scummvm: [21986] scummvm/trunk/engines/kyra/sequences_v1.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Mon Apr 17 12:32:02 CEST 2006


Revision: 21986
Author:   eriktorbjorn
Date:     2006-04-17 12:31:05 -0700 (Mon, 17 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21986&view=rev

Log Message:
-----------
Rewrote the timing of the Kyra end credits so that it doesn't matter that the
variables are signed. Otherwise the credits may hang on a slow system.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/sequences_v1.cpp
Modified: scummvm/trunk/engines/kyra/sequences_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_v1.cpp	2006-04-17 18:54:20 UTC (rev 21985)
+++ scummvm/trunk/engines/kyra/sequences_v1.cpp	2006-04-17 19:31:05 UTC (rev 21986)
@@ -1099,9 +1099,8 @@
 	OSystem::Event event;	
 	bool finished = false;
 	int bottom = 201;
-	uint32 startLoop, waitTime;
 	while (!finished) {
-		startLoop = _system->getMillis();
+		uint32 startLoop = _system->getMillis();
 		if (bottom > 175) {
 			_screen->copyRegion(8, 32, 8, 32, 312, 128, 4, 2);
 			bottom = 0;
@@ -1132,10 +1131,12 @@
 				break;
 			}
 		}
-		
-		waitTime = startLoop + _tickLength * 5 - _system->getMillis();
-		if (waitTime > 0)
-			_system->delayMillis(waitTime);	
+
+		uint32 now = _system->getMillis();
+		uint32 nextLoop = startLoop + _tickLength * 5;
+
+		if (nextLoop > now)
+			_system->delayMillis(nextLoop - now);
 	}
 	
 	delete[] buffer;


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