[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.312,1.313 string.cpp,1.185,1.186

Max Horn fingolfin at users.sourceforge.net
Thu Jan 15 12:40:03 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv12055

Modified Files:
	sound.cpp string.cpp 
Log Message:
fixed COMI speech behaviour

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.312
retrieving revision 1.313
diff -u -d -r1.312 -r1.313
--- sound.cpp	10 Jan 2004 11:01:47 -0000	1.312
+++ sound.cpp	15 Jan 2004 20:39:24 -0000	1.313
@@ -405,21 +405,19 @@
 }
 
 void Sound::processSfxQueues() {
-	Actor *a;
-	int act;
-	bool b, finished;
 
 	if (_talk_sound_mode != 0) {
 		if (_talk_sound_mode & 1)
 			startTalkSound(_talk_sound_a1, _talk_sound_b1, 1);
-		if (_talk_sound_mode & 2) {
+		if (_talk_sound_mode & 2)
 			startTalkSound(_talk_sound_a2, _talk_sound_b2, 2, &_talkChannelHandle);
-		}
 		_talk_sound_mode = 0;
 	}
 
-	if ((_sfxMode & 2) && _vm->VAR(_vm->VAR_TALK_ACTOR)) {
-		act = _vm->VAR(_vm->VAR_TALK_ACTOR);
+	const int act = _vm->VAR(_vm->VAR_TALK_ACTOR);
+	if ((_sfxMode & 2) && act != 0) {
+		Actor *a;
+		bool b, finished;
 
 		if (_vm->_imuseDigital) {
 			finished = !isSoundRunning(kTalkSoundID);
@@ -427,9 +425,9 @@
 			finished = !_talkChannelHandle.isActive();
 		}
 
-		if (act != 0 && (uint) act < 0x80 && !_vm->_string[0].no_talk_anim) {
+		if ((uint) act < 0x80 && !_vm->_string[0].no_talk_anim && (finished || !_endOfMouthSync)) {
 			a = _vm->derefActor(act, "processSfxQueues");
-			if (a->isInCurrentRoom() && (finished || !_endOfMouthSync)) {
+			if (a->isInCurrentRoom()) {
 				b = finished || isMouthSyncOff(_curSoundPos);
 				if (_mouthSyncMode != b) {
 					_mouthSyncMode = b;
@@ -464,6 +462,11 @@
 	byte *sound;
 	int id = -1;
 
+	if (_vm->_gameId == GID_CMI) {
+		_sfxMode |= mode;
+		return;
+	}
+
 	if ((_vm->_gameId == GID_DIG) && (_vm->_features & GF_DEMO)) {
 		char filename[30];
 		char roomname[10];

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- string.cpp	9 Jan 2004 13:14:59 -0000	1.185
+++ string.cpp	15 Jan 2004 20:39:24 -0000	1.186
@@ -166,13 +166,6 @@
 	if (_talkDelay)
 		return;
 
-	if ((_gameId == GID_CMI || _gameId == GID_DIG) && (_imuseDigital)
-				&& _sound->isSoundRunning(kTalkSoundID)) {
-		// Keep the 'speech' flag in _sound->_sfxMode set as long as the
-		// sound kTalkSoundID is playing.
-		_sound->_sfxMode |= 2;
-	}
-
 	if (_haveMsg == 1) {
 		if ((_sound->_sfxMode & 2) == 0)
 			stopTalk();
@@ -892,8 +885,14 @@
 		// Play speech
 		if (!(_features & GF_DEMO) && (_gameId == GID_CMI)) // CMI demo does not have .IMX for voice
 			strcat(pointer, ".IMX");
-//		_imuseDigital->stopSound(kTalkSoundID);
-		_imuseDigital->startVoice(kTalkSoundID, pointer);
+		// FIXME: This is a hack to distinguish between 'real' actor speech and
+		// some odd (?) other strings... there is probably a better way to do this.
+		// I just don't know which (yet).
+		if (ptr[i+1] != 0 && ptr[i+1] != 255) {
+			_sound->stopTalkSound();
+			_imuseDigital->startVoice(kTalkSoundID, pointer);
+			_sound->talkSound(0, 0, 2, -1);
+		}
 
 		ptr = _transText;
 	}





More information about the Scummvm-git-logs mailing list