[Scummvm-cvs-logs] SF.net SVN: scummvm: [21787] scummvm/trunk/engines/lure

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Tue Apr 11 04:56:01 CEST 2006


Revision: 21787
Author:   eriktorbjorn
Date:     2006-04-11 04:55:27 -0700 (Tue, 11 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21787&view=rev

Log Message:
-----------
Added delays to the main and menu event loops to keep Lure from gobbling up all
available CPU time.

Modified Paths:
--------------
    scummvm/trunk/engines/lure/game.cpp
    scummvm/trunk/engines/lure/menu.cpp
Modified: scummvm/trunk/engines/lure/game.cpp
===================================================================
--- scummvm/trunk/engines/lure/game.cpp	2006-04-11 11:34:06 UTC (rev 21786)
+++ scummvm/trunk/engines/lure/game.cpp	2006-04-11 11:55:27 UTC (rev 21787)
@@ -109,7 +109,7 @@
 		}
 		res.delayList().tick();
 
-		if (events.pollEvent()) {
+		while (events.pollEvent()) {
 			if (events.type() == OSystem::EVENT_KEYDOWN) {
 				uint16 roomNum = r.roomNumber();
 
@@ -171,6 +171,8 @@
 		if (destRoom != 0) {
 			playerChangeRoom();
 		}
+
+		system.delayMillis(10);
 	}
 
 	r.leaveRoom();

Modified: scummvm/trunk/engines/lure/menu.cpp
===================================================================
--- scummvm/trunk/engines/lure/menu.cpp	2006-04-11 11:34:06 UTC (rev 21786)
+++ scummvm/trunk/engines/lure/menu.cpp	2006-04-11 11:55:27 UTC (rev 21787)
@@ -110,7 +110,7 @@
 	_selectedIndex = 0;
 
 	while (mouse.lButton() || mouse.rButton()) {
-		if (events.pollEvent()) {
+		while (events.pollEvent()) {
 			if (events.quitFlag) return MENUITEM_NONE;
 
 			if (mouse.y() < MENUBAR_Y_SIZE)
@@ -155,6 +155,8 @@
 				if (_selectedIndex != 0) toggleHighlightItem(_selectedIndex);
 			}
 		}
+
+		system.delayMillis(10);
 	}
 
 	if (_surfaceMenu) delete _surfaceMenu;


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