[Scummvm-cvs-logs] SF.net SVN: scummvm: [20718] scummvm/trunk/engines/scumm

kirben at users.sourceforge.net kirben at users.sourceforge.net
Wed Feb 15 21:53:15 CET 2006


Revision: 20718
Author:   kirben
Date:     2006-02-15 21:52:39 -0800 (Wed, 15 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20718&view=rev

Log Message:
-----------
Clear sound queue when stopping sound channel in HE games

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/sound_he.cpp
    scummvm/trunk/engines/scumm/sound.cpp
    scummvm/trunk/engines/scumm/sound.h
Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-02-16 05:37:45 UTC (rev 20717)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-02-16 05:52:39 UTC (rev 20718)
@@ -44,6 +44,25 @@
 
 namespace Scumm {
 
+void Sound::stopSoundChannel(int chan) {
+	_vm->_mixer->stopHandle(_heSoundChannels[chan]);
+
+	_heChannel[chan].sound = 0;
+	_heChannel[chan].priority = 0;
+	_heChannel[chan].sbngBlock = 0;
+	_heChannel[chan].codeOffs = 0;
+	memset(_heChannel[chan].soundVars, 0, sizeof(_heChannel[chan].soundVars));
+
+	for (int i = 0; i < ARRAYSIZE(_soundQue2); i++) {
+		if (_soundQue2[i].channel == chan) {
+			_soundQue2[i].sound = 0;
+			_soundQue2[i].offset = 0;
+			_soundQue2[i].channel = 0;
+			_soundQue2[i].flags = 0;
+		}
+	}
+}
+
 int Sound::findFreeSoundChannel() {
 	int chan, min;
 

Modified: scummvm/trunk/engines/scumm/sound.cpp
===================================================================
--- scummvm/trunk/engines/scumm/sound.cpp	2006-02-16 05:37:45 UTC (rev 20717)
+++ scummvm/trunk/engines/scumm/sound.cpp	2006-02-16 05:52:39 UTC (rev 20718)
@@ -821,13 +821,7 @@
 
 	if (_vm->_heversion >= 70) {
 		if ( sound >= 10000) {
-			int chan = sound - 10000;
-			_vm->_mixer->stopHandle(_heSoundChannels[chan]);
-			_heChannel[chan].sound = 0;
-			_heChannel[chan].priority = 0;
-			_heChannel[chan].sbngBlock = 0;
-			_heChannel[chan].codeOffs = 0;
-			memset(_heChannel[chan].soundVars, 0, sizeof(_heChannel[chan].soundVars));
+			stopSoundChannel(sound - 10000);
 		}
 	} else if (_vm->_heversion >= 60) {
 		if (sound == -2) {

Modified: scummvm/trunk/engines/scumm/sound.h
===================================================================
--- scummvm/trunk/engines/scumm/sound.h	2006-02-16 05:37:45 UTC (rev 20717)
+++ scummvm/trunk/engines/scumm/sound.h	2006-02-16 05:52:39 UTC (rev 20718)
@@ -155,6 +155,7 @@
 	void setOverrideFreq(int freq);
 	void setupHEMusicFile();
 	void startHETalkSound(uint32 offset);
+	void stopSoundChannel(int chan);
 
 	// Used by the save/load system:
 	void saveLoadWithSerializer(Serializer *ser);







More information about the Scummvm-git-logs mailing list