[Scummvm-cvs-logs] CVS: scummvm/scumm/imuse_digi dimuse_track.cpp,1.36,1.37

Max Horn fingolfin at users.sourceforge.net
Wed Nov 24 06:40:01 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm/imuse_digi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30016

Modified Files:
	dimuse_track.cpp 
Log Message:
(Partial) fix for bug #1035690 (COMI: cannon shooting uses a lot of performance) -- remember, busy waiting is almost always bad, esp. when waiting for another thread...

Index: dimuse_track.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_track.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- dimuse_track.cpp	24 Nov 2004 09:47:32 -0000	1.36
+++ dimuse_track.cpp	24 Nov 2004 10:00:02 -0000	1.37
@@ -77,10 +77,12 @@
 
 	Track *track = _track[l];
 	while (track->used) {
-#if defined(_WIN32_WCE) || defined (__PALM_OS__)
-		_vm->parseEvents(); // timers are events, we need to consume them
-#endif
+		// The designated track is not yet available. So, we call flushTracks()
+		// to get it processed (and thus made ready for us). Since the actual
+		// processing is done by another thread, we also call parseEvents to
+		// give it some time (and to avoid busy waiting/looping).
 		flushTracks();
+		_vm->parseEvents();
 	}
 
 	track->pan = 64;





More information about the Scummvm-git-logs mailing list