[Scummvm-cvs-logs] SF.net SVN: scummvm:[38765] scummvm/trunk/engines/sci/engine

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sun Feb 22 00:16:04 CET 2009


Revision: 38765
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38765&view=rev
Author:   wjpalenstijn
Date:     2009-02-21 23:16:03 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
multiply before dividing to improve timer resolution

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-21 22:59:50 UTC (rev 38764)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-21 23:16:03 UTC (rev 38765)
@@ -510,14 +510,14 @@
 #endif
 
 	g_system->getTimeAndDate(loc_time);
-	start_time = g_system->getMillis() / 1000;
+	start_time = g_system->getMillis();
 
 	if (s->version < SCI_VERSION_FTU_NEW_GETTIME) { // Use old semantics
 		if (argc) { // Get seconds since last am/pm switch
 			retval = loc_time.tm_sec + loc_time.tm_min * 60 + (loc_time.tm_hour % 12) * 3600;
 			debugC(2, kDebugLevelTime, "GetTime(timeofday) returns %d", retval);
 		} else { // Get time since game started
-			retval = start_time * 60;
+			retval = start_time * 60 / 1000;
 			debugC(2, kDebugLevelTime, "GetTime(elapsed) returns %d", retval);
 		}
 	} else {
@@ -527,7 +527,7 @@
 
 		switch (mode) {
 		case _K_NEW_GETTIME_TICKS : {
-			retval = start_time * 60;
+			retval = start_time * 60 / 1000;
 			debugC(2, kDebugLevelTime, "GetTime(elapsed) returns %d", retval);
 			break;
 		}

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-21 22:59:50 UTC (rev 38764)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-21 23:16:03 UTC (rev 38765)
@@ -651,7 +651,7 @@
 	int sleep_time = UKPV(0);
 
 	time = g_system->getMillis();
-	s->r_acc = make_reg(0, ((time - s->last_wait_time) / 1000) * 60);
+	s->r_acc = make_reg(0, ((long)time - (long)s->last_wait_time) * 60 / 1000);
 	s->last_wait_time = time;
 
 	// Reset optimization flags: Game is playing along nicely anyway


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