[Scummvm-cvs-logs] CVS: scummvm/queen cutaway.cpp,1.140,1.141 journal.cpp,1.44,1.45 queen.cpp,1.111,1.112 sound.cpp,1.47,1.48 sound.h,1.24,1.25 talk.cpp,1.112,1.113

Gregory Montoir cyx at users.sourceforge.net
Sun Dec 19 04:20:00 CET 2004


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

Modified Files:
	cutaway.cpp journal.cpp queen.cpp sound.cpp sound.h talk.cpp 
Log Message:
Fixed regression in queen floppy version. Before doing any speech/texts synchronization, we check the voice sfx exists. See also patch #1087870

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- cutaway.cpp	6 Dec 2004 20:42:10 -0000	1.140
+++ cutaway.cpp	19 Dec 2004 12:19:20 -0000	1.141
@@ -960,7 +960,7 @@
 
 	// if the cutaway has been cancelled, we must stop the speech and the sfx as well
 	if (_vm->input()->cutawayQuit()) {
-		if (_vm->sound()->speechOn())
+		if (_vm->sound()->isSpeechActive())
 			_vm->sound()->stopSpeech();
 		_vm->sound()->stopSfx();
 	}
@@ -1262,7 +1262,7 @@
 			break;
 		}
 
-		if ((OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) && _vm->sound()->speechOn()) {
+		if ((OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) && _vm->sound()->speechOn() && _vm->sound()->speechSfxExists()) {
 			if (!_vm->sound()->isSpeechActive()) {
 				break;
 			}

Index: journal.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/journal.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- journal.cpp	17 Dec 2004 13:49:54 -0000	1.44
+++ journal.cpp	19 Dec 2004 12:19:21 -0000	1.45
@@ -247,10 +247,7 @@
 		}
 		drawConfigPanel();
 	} else if (zoneNum == ZN_VOICE_TOGGLE) {
-		if (_vm->resource()->isCD())
-			_vm->sound()->toggleSpeech();
-		else
-			_vm->sound()->speechToggle(false);
+		_vm->sound()->toggleSpeech();
 		drawConfigPanel();
 	} else if (zoneNum == ZN_TEXT_TOGGLE) {
 		_vm->subtitles(!_vm->subtitles());

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- queen.cpp	17 Dec 2004 16:49:31 -0000	1.111
+++ queen.cpp	19 Dec 2004 12:19:21 -0000	1.112
@@ -110,7 +110,7 @@
 	ConfMan.registerDefault("music_mute", false);
 	ConfMan.registerDefault("sfx_mute", false);
 	ConfMan.registerDefault("talkspeed", Logic::DEFAULT_TALK_SPEED);
-	ConfMan.registerDefault("speech_mute", !_resource->isCD());
+	ConfMan.registerDefault("speech_mute", _resource->isDemo() || _resource->isInterview());
 	ConfMan.registerDefault("subtitles", true);
 }
 
@@ -126,6 +126,11 @@
 	if (!_sound->speechOn()) {
 		_subtitles = true;
 	}
+	
+	// demo and interview versions don't have speech at all
+	if (_sound->speechOn() && (_resource->isDemo() || _resource->isInterview())) {
+		_sound->speechToggle(false);
+	}
 }
 
 void QueenEngine::readOptionSettings() {
@@ -133,7 +138,7 @@
 	_sound->musicToggle(!ConfMan.getBool("music_mute"));
 	_sound->sfxToggle(!ConfMan.getBool("sfx_mute"));
 	_talkSpeed = ConfMan.getInt("talkspeed");
-	_sound->speechToggle(_resource->isCD() ? !ConfMan.getBool("speech_mute"): false);
+	_sound->speechToggle(!ConfMan.getBool("speech_mute"));
 	_subtitles = ConfMan.getBool("subtitles");
 	checkOptionSettings();
 }

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- sound.cpp	27 Nov 2004 15:58:07 -0000	1.47
+++ sound.cpp	19 Dec 2004 12:19:21 -0000	1.48
@@ -92,7 +92,7 @@
 
 void Sound::playSfx(uint16 sfx, bool isSpeech) {
 	if (isSpeech && !speechOn()) return;
-        else if (!sfxOn()) return;
+	else if (!sfxOn()) return;
 
 	if (sfx != 0) {
 		char name[13];
@@ -103,7 +103,12 @@
 #endif
 		strcat(name, ".SB");
 		waitFinished(isSpeech);
-		sfxPlay(name, isSpeech);
+		if (_vm->resource()->fileExists(name)) {
+			sfxPlay(name, isSpeech);
+			_speechSfxExists = isSpeech;
+		} else {
+			_speechSfxExists = false;
+		}
 	}
 }
 
@@ -120,7 +125,12 @@
 	}
 	strcat(name, ".SB");
 	waitFinished(isSpeech);
-	sfxPlay(name, isSpeech);
+	if (_vm->resource()->fileExists(name)) {
+		sfxPlay(name, isSpeech);
+		_speechSfxExists = isSpeech;
+	} else {
+		_speechSfxExists = false;
+	}
 }
 
 void Sound::playSong(int16 songNum) {
@@ -182,40 +192,32 @@
 }
 
 void SBSound::sfxPlay(const char *name, bool isSpeech) {
-	if (_vm->resource()->fileExists(name)) {
-		uint32 size;
-		uint8 *buf = _vm->resource()->loadFile(name, SB_HEADER_SIZE, &size, true);
-		playSound(buf, size, isSpeech);
-	}
+	uint32 size;
+	uint8 *buf = _vm->resource()->loadFile(name, SB_HEADER_SIZE, &size, true);
+	playSound(buf, size, isSpeech);
 }
 
 #ifdef USE_MAD
 void MP3Sound::sfxPlay(const char *name, bool isSpeech) {
-	if (_vm->resource()->fileExists(name)) {
-		uint32 size;
-		File *f = _vm->resource()->giveCompressedSound(name, &size);
-		_mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size), false);
-	}
+	uint32 size;
+	File *f = _vm->resource()->giveCompressedSound(name, &size);
+	_mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size), false);
 }
 #endif
 
 #ifdef USE_VORBIS
 void OGGSound::sfxPlay(const char *name, bool isSpeech) {
-	if (_vm->resource()->fileExists(name)) {
-		uint32 size;
-		File *f = _vm->resource()->giveCompressedSound(name, &size);		
-		_mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size), false);
-	}
+	uint32 size;
+	File *f = _vm->resource()->giveCompressedSound(name, &size);		
+	_mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size), false);
 }
 #endif
 
 #ifdef USE_FLAC
 void FLACSound::sfxPlay(const char *name, bool isSpeech) {
-	if (_vm->resource()->fileExists(name)) {
-		uint32 size;
-		File *f = _vm->resource()->giveCompressedSound(name, &size);		
-		_mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size), false);
-	}
+	uint32 size;
+	File *f = _vm->resource()->giveCompressedSound(name, &size);		
+	_mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size), false);
 }
 #endif
 

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- sound.h	22 Nov 2004 22:16:50 -0000	1.24
+++ sound.h	19 Dec 2004 12:19:21 -0000	1.25
@@ -77,6 +77,8 @@
 	bool isSpeechActive() const	{ return _speechHandle.isActive(); }
 	bool isSfxActive() const 	{ return _sfxHandle.isActive(); }
 	
+	bool speechSfxExists() const	{ return _speechSfxExists; }
+	
 	int16 lastOverride() const	{ return _lastOverride; }
 
 	void saveState(byte *&ptr);
@@ -107,6 +109,7 @@
 	bool _sfxToggle;
 	bool _speechToggle;
 	bool _musicToggle;
+	bool _speechSfxExists;
 	
 	int16 _lastOverride;
 	PlayingSoundHandle _sfxHandle;

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- talk.cpp	6 Dec 2004 20:42:11 -0000	1.112
+++ talk.cpp	19 Dec 2004 12:19:21 -0000	1.113
@@ -757,7 +757,7 @@
 				break;
 			}
 			
-			if (_vm->sound()->speechOn()) {
+			if (_vm->sound()->speechOn() && _vm->sound()->speechSfxExists()) {
 				// sfx is finished, stop the speak animation
 				if (!_vm->sound()->isSpeechActive()) {
 					break;
@@ -772,7 +772,7 @@
 		}
 	}
 
-	// Make sure that Person closes their mouths
+	// Make sure that Person closes their mouth
 	if (!isJoe && parameters->ff > 0)
 		_vm->bankMan()->overpack(parameters->ff, startFrame, bankNum);
 }
@@ -834,7 +834,7 @@
 	if (!isJoe) {
 		if (SPEAK_AMAL_ON == command) {
 			// It's the oracle!
-			// Dont turn AMAL animation off, and dont manually anim person
+			// Don't turn AMAL animation off, and don't manually anim person
 			command = SPEAK_ORACLE;
 			oracle = true;
 			uint16 frameNum = _vm->graphics()->personFrames(bobNum);





More information about the Scummvm-git-logs mailing list