[Scummvm-cvs-logs] SF.net SVN: scummvm: [26350] scummvm/trunk/engines/touche/touche.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Apr 1 16:53:04 CEST 2007


Revision: 26350
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26350&view=rev
Author:   eriktorbjorn
Date:     2007-04-01 07:53:03 -0700 (Sun, 01 Apr 2007)

Log Message:
-----------
Make the mouse cursor move more smoothly. (Most of this improvement actually
comes from calling processEvents(), not from calling updateScreen() more
often.)

Modified Paths:
--------------
    scummvm/trunk/engines/touche/touche.cpp

Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp	2007-04-01 14:35:33 UTC (rev 26349)
+++ scummvm/trunk/engines/touche/touche.cpp	2007-04-01 14:53:03 UTC (rev 26350)
@@ -268,14 +268,18 @@
 			fadePaletteFromFlags();
 		}
 
-		_system->updateScreen();
-		int delay = _system->getMillis() - frameTimeStamp;
-		delay = (_fastMode ? 10 : kCycleDelay) - delay;
-		if (delay < 1) {
-			delay = 1;
+		uint32 nextFrame = frameTimeStamp + (_fastMode ? 10 : kCycleDelay);
+		uint32 now = _system->getMillis();
+		if (nextFrame < now) {
+			nextFrame = now + 1;
 		}
-		_system->delayMillis(delay);
-		frameTimeStamp = _system->getMillis();
+		while (now < nextFrame) {
+			processEvents();
+			_system->updateScreen();
+			now = _system->getMillis();
+			_system->delayMillis((nextFrame - now >= 10) ? 10 : nextFrame - now);
+		}
+		frameTimeStamp = nextFrame;
 	}
 
 	writeConfigurationSettings();


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