[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.359,1.360 sound.h,1.71,1.72 string.cpp,1.233,1.234

Travis Howell kirben at users.sourceforge.net
Sun Aug 8 17:59:11 CEST 2004


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

Modified Files:
	sound.cpp sound.h string.cpp 
Log Message:

Fix bug #780922 - SAM: Conroy doesn't stop singing when escaping cutscene


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.359
retrieving revision 1.360
diff -u -d -r1.359 -r1.360
--- sound.cpp	26 Jul 2004 23:15:01 -0000	1.359
+++ sound.cpp	9 Aug 2004 00:58:21 -0000	1.360
@@ -64,6 +64,7 @@
 	_talk_sound_b1(0),
 	_talk_sound_b2(0),
 	_talk_sound_mode(0),
+	_talk_sound_channel(0),
 	_mouthSyncMode(false),
 	_endOfMouthSync(false),
 	_curSoundPos(0),
@@ -623,15 +624,9 @@
 		// Some games frequently assume that starting one sound effect will
 		// automatically stop any other that may be playing at that time. So
 		// that is what we do here, but we make an exception for speech.
-		//
-		// Do any other games than these need this hack?
-		//
-		// HACK: Checking for script 99 in Sam & Max is to keep Conroy's song
-		// from being interrupted.
 
-		if (mode == 1 && (_vm->_gameId == GID_TENTACLE
-			|| (_vm->_gameId == GID_SAMNMAX && !_vm->isScriptRunning(99)))) {
-			id = 777777;
+		if (mode == 1 && (_vm->_gameId == GID_TENTACLE || _vm->_gameId == GID_SAMNMAX)) {
+			id = 777777 + _talk_sound_channel;
 			_vm->_mixer->stopID(id);
 		}
 
@@ -875,10 +870,11 @@
 	}
 }
 
-void Sound::talkSound(uint32 a, uint32 b, int mode) {
+void Sound::talkSound(uint32 a, uint32 b, int mode, int channel) {
 	if (mode == 1) {
 		_talk_sound_a1 = a;
 		_talk_sound_b1 = b;
+		_talk_sound_channel = channel;
 	} else {
 		_talk_sound_a2 = a;
 		_talk_sound_b2 = b;

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- sound.h	26 Jul 2004 23:15:01 -0000	1.71
+++ sound.h	9 Aug 2004 00:58:21 -0000	1.72
@@ -64,7 +64,7 @@
 	int _numSoundEffects;		// For compressed audio
 
 	uint32 _talk_sound_a1, _talk_sound_a2, _talk_sound_b1, _talk_sound_b2;
-	byte _talk_sound_mode;
+	byte _talk_sound_mode, _talk_sound_channel;
 	bool _mouthSyncMode;
 	bool _endOfMouthSync;
 	uint16 _mouthSyncTimes[64];
@@ -97,7 +97,7 @@
 	void stopSound(int a);
 	void stopAllSounds();
 	void soundKludge(int *list, int num);
-	void talkSound(uint32 a, uint32 b, int mode);
+	void talkSound(uint32 a, uint32 b, int mode, int channel = 0);
 	void setupSound();
 	void pauseSounds(bool pause);
 

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -d -r1.233 -r1.234
--- string.cpp	8 Aug 2004 22:39:07 -0000	1.233
+++ string.cpp	9 Aug 2004 00:58:21 -0000	1.234
@@ -52,10 +52,8 @@
 
 		// Sam and Max uses a caching system, printing empty messages
 		// and setting VAR_V6_SOUNDMODE beforehand. See patch 609791.
-		// FIXME: There are other VAR_V6_SOUNDMODE states, as
-		// mentioned in the patch. FIXME after iMUSE is done.
-		if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2))
-			_sound->talkSound(a, b, 1);
+		if (VAR(VAR_V6_SOUNDMODE) != 2)
+			_sound->talkSound(a, b, 1, VAR(VAR_V6_SOUNDMODE));
 	}
 }
 





More information about the Scummvm-git-logs mailing list