[Scummvm-cvs-logs] SF.net SVN: scummvm:[52043] scummvm/trunk/engines/sci/sound

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Aug 12 17:45:54 CEST 2010


Revision: 52043
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52043&view=rev
Author:   m_kiewitz
Date:     2010-08-12 15:45:53 +0000 (Thu, 12 Aug 2010)

Log Message:
-----------
SCI: queuing signal, if signal not passed to scripts

fixes laura bow 1 when knocking at the door in the attic, scripts wait for 0xb in that case, sound resource sets 0xb and then immediately ends. This resulted in the scripts only getting the termination signal, so they waited endlessly. (bug #3042981)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
    scummvm/trunk/engines/sci/sound/music.cpp
    scummvm/trunk/engines/sci/sound/music.h

Modified: scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.cpp	2010-08-12 15:19:04 UTC (rev 52042)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.cpp	2010-08-12 15:45:53 UTC (rev 52043)
@@ -445,7 +445,12 @@
 	}
 	if (_signalSet) {
 		_signalSet = false;
-		_pSnd->signal = _signalToSet;
+		if (!_pSnd->signal) {
+			_pSnd->signal = _signalToSet;
+		} else {
+			// signal already set and waiting for getting to scripts, queue new one
+			_pSnd->signalQueue.push_back(_signalToSet);
+		}
 		debugC(4, kDebugLevelSound, "signal %04x", _signalToSet);
 	}
 
@@ -608,7 +613,12 @@
 					jumpToTick(_loopTick);
 				} else {
 					_pSnd->status = kSoundStopped;
-					_pSnd->signal = SIGNAL_OFFSET;
+					if (!_pSnd->signal) {
+						_pSnd->signal = SIGNAL_OFFSET;
+					} else {
+						// signal already set and waiting for getting to scripts, queue new one
+						_pSnd->signalQueue.push_back(SIGNAL_OFFSET);
+					}
 
 					debugC(4, kDebugLevelSound, "signal EOT");
 				}

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-08-12 15:19:04 UTC (rev 52042)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-08-12 15:45:53 UTC (rev 52043)
@@ -638,6 +638,14 @@
 }
 
 void MusicEntry::onTimer() {
+	if (!signal) {
+		if (!signalQueue.empty()) {
+			// no signal set, but signal in queue, set that one
+			signal = signalQueue[0];
+			signalQueue.remove_at(0);
+		}
+	}
+
 	if (status != kSoundPlaying)
 		return;
 

Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sound/music.h	2010-08-12 15:19:04 UTC (rev 52042)
+++ scummvm/trunk/engines/sci/sound/music.h	2010-08-12 15:45:53 UTC (rev 52043)
@@ -51,6 +51,8 @@
 class MidiParser_SCI;
 class SegManager;
 
+typedef Common::Array<uint16> SignalQueue;
+
 class MusicEntry : public Common::Serializable {
 public:
 	// Do not get these directly for the sound objects!
@@ -90,6 +92,11 @@
 
 	MidiParser_SCI *pMidiParser;
 
+	// this is used for storing signals, when the current signal is not yet
+	//  sent to the scripts. We shouldn't need to save it, this normally only
+	//  happens in rare situations like lb1, knocking on the door in the attic
+	SignalQueue signalQueue;
+
 	// TODO: We need to revise how we store the different
 	// audio stream objects we require.
 	Audio::RewindableAudioStream *pStreamAud;


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