From e8d04067a08a91f8eae5a9d3178518f9f8cebc78 Mon Sep 17 00:00:00 2001 From: Jamieson Christian Date: Sun, 10 Aug 2003 11:44:43 +0000 Subject: Fix for Bug [785373] SAM: Overlapping music at Bigfoot convention Included the ImDeferredCommand list when checking for sounds that have been queued to play. Also added sound queue processing between execution of exit script and entry script. In the case of this bug, the entry script required that the iMuse state be fully up to date, including last-moment changes from the previous exit script. svn-id: r9622 --- scumm/imuse.cpp | 9 +++++++++ scumm/scummvm.cpp | 1 + 2 files changed, 10 insertions(+) diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 4dea9ec6e9..44ad845a59 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -454,6 +454,15 @@ int IMuseInternal::get_queue_sound_status(int sound) { return 2; i = (i + 1) &(ARRAYSIZE(_cmd_queue) - 1); } + + for (i = 0; i < ARRAYSIZE (_deferredCommands); ++i) { + if (_deferredCommands[i].time_left && _deferredCommands[i].a == 8 && + _deferredCommands[i].b == sound) + { + return 2; + } + } + return 0; } diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index a6583d1ece..0a75b46ba5 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1743,6 +1743,7 @@ void Scumm::startScene(int room, Actor *a, int objectNr) { killScriptsAndResources(); clearEnqueue(); stopCycle(0); + _sound->processSoundQues(); for (i = 1; i < _numActors; i++) { _actors[i].hideActor(); -- cgit v1.2.3