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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Oct 22 23:30:31 CEST 2009


Revision: 45342
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45342&view=rev
Author:   m_kiewitz
Date:     2009-10-22 21:30:30 +0000 (Thu, 22 Oct 2009)

Log Message:
-----------
SCI: kGameIsRestarting - implemented speed throttler in here for sci0/sci01 games, test only!

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

Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp	2009-10-22 21:19:03 UTC (rev 45341)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp	2009-10-22 21:30:30 UTC (rev 45342)
@@ -55,6 +55,27 @@
 			s->restarting_flags &= ~SCI_GAME_WAS_RESTARTED;
 	}
 
+	if (getSciVersion() <= SCI_VERSION_01) {
+		// Do speed throttling for SCI0/SCI01 games in here, actually just a test if lsl3 pushups get fixed that way
+		uint32 curTime = g_system->getMillis();
+		uint32 duration = curTime - s->_lastAnimateTime;
+		uint32 neededSleep = 40;
+
+		// We are doing this, so that games like sq3 dont think we are running too slow and will remove details (like
+		//  animated sierra logo at the beginning). Hopefully this wont cause regressions with pullups in lsl3 (FIXME?)
+		if (s->_lastAnimateCounter < 10) {
+			s->_lastAnimateCounter++;
+			neededSleep = 8;
+		}
+
+		if (duration < neededSleep) {
+			g_system->delayMillis(neededSleep - duration);
+			s->_lastAnimateTime = g_system->getMillis();
+		} else {
+			s->_lastAnimateTime = curTime;
+		}
+	}
+
 	return s->r_acc;
 }
 


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