From 147a09bcf5d4182fd8fbff9ce53cfeaa13f4af60 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 24 Nov 2004 10:00:02 +0000 Subject: (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... svn-id: r15875 --- scumm/imuse_digi/dimuse_track.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scumm') diff --git a/scumm/imuse_digi/dimuse_track.cpp b/scumm/imuse_digi/dimuse_track.cpp index 2a20a166e9..3dfa13372a 100644 --- a/scumm/imuse_digi/dimuse_track.cpp +++ b/scumm/imuse_digi/dimuse_track.cpp @@ -77,10 +77,12 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, 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; -- cgit v1.2.3