[Scummvm-cvs-logs] scummvm master -> e02965c40a607209cc7a46b78cfeab21b0e292da

dreammaster dreammaster at scummvm.org
Fri Aug 14 00:44:40 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e02965c40a SHERLOCK: RT: SImplification of old speech code


Commit: e02965c40a607209cc7a46b78cfeab21b0e292da
    https://github.com/scummvm/scummvm/commit/e02965c40a607209cc7a46b78cfeab21b0e292da
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-13T18:43:51-04:00

Commit Message:
SHERLOCK: RT: SImplification of old speech code

Changed paths:
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/sound.cpp
    engines/sherlock/sound.h
    engines/sherlock/talk.cpp



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 80e9b79..2fd9ede 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -487,11 +487,10 @@ OpcodeReturn ScalpelTalk::cmdSfxCommand(const byte *&str) {
 	if (sound._voices) {
 		for (int idx = 0; idx < 8 && str[idx] != '~'; ++idx)
 			tempString += str[idx];
-		sound.playSound(tempString, WAIT_RETURN_IMMEDIATELY);
+		sound.playSpeech(tempString);
 
 		// Set voices to wait for more
 		sound._voices = 2;
-		sound._speechOn = (*sound._soundIsOn);
 	}
 
 	_wait = 1;
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 5fe8c74..f948b78 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -1637,13 +1637,12 @@ void ScalpelUserInterface::doTalkControl() {
 			people.setTalking(0);
 
 			if (!talk._statements[_selector]._voiceFile.empty() && sound._voices) {
-				sound.playSound(talk._statements[_selector]._voiceFile, WAIT_RETURN_IMMEDIATELY);
+				sound.playSpeech(talk._statements[_selector]._voiceFile);
 
 				// Set voices as an indicator for waiting
 				sound._voices = 2;
-				sound._speechOn = *sound._soundIsOn;
 			} else {
-				sound._speechOn = false;
+				sound._speechPlaying = false;
 			}
 
 			if (IS_3DO)
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index c9b30b1..f8d07e5 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -57,9 +57,7 @@ Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 	_voices = 0;
 	_soundPlaying = false;
 	_speechPlaying = false;
-	_soundIsOn = &_soundPlaying;
 	_curPriority = 0;
-	_digiBuf = nullptr;
 	_soundVolume = 255;
 
 	_soundOn = true;
@@ -242,8 +240,6 @@ void Sound::stopSndFuncPtr(int v1, int v2) {
 }
 
 void Sound::freeDigiSound() {
-	delete[] _digiBuf;
-	_digiBuf = nullptr;
 	_soundPlaying = false;
 }
 
@@ -265,6 +261,11 @@ void Sound::playSpeech(const Common::String &name) {
 	Scene &scene = *_vm->_scene;
 	stopSpeech();
 
+	// TODO: Technically Scalpel has an sfx command which I've set to call this method because it sets the
+	// _voice variable as if it were speech. Need to do a play-through of Scalpel and see if it's ever called.
+	// If so, will need to enhance this method to handle the Serrated Scalpel voice resources
+	assert(IS_ROSE_TATTOO);
+
 	// Figure out which speech library to use
 	Common::String libraryName = Common::String::format("speech%02d.lib", scene._currentScene);
 	if ((!scumm_strnicmp(name.c_str(), "SLVE12S", 7)) || (!scumm_strnicmp(name.c_str(), "WATS12X", 7))
diff --git a/engines/sherlock/sound.h b/engines/sherlock/sound.h
index 3894d16..c71a29c 100644
--- a/engines/sherlock/sound.h
+++ b/engines/sherlock/sound.h
@@ -58,8 +58,6 @@ public:
 	bool _speechOn;
 	bool _soundPlaying;
 	bool _speechPlaying;
-	bool *_soundIsOn;
-	byte *_digiBuf;
 	int _soundVolume;
 
 	Common::String _talkSoundFile;
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index ab8eed8..7811aa3 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -937,7 +937,7 @@ int Talk::waitForMore(int delay) {
 	}
 
 	do {
-		if (IS_SERRATED_SCALPEL && sound._speechOn && !*sound._soundIsOn)
+		if (IS_SERRATED_SCALPEL && sound._speechOn && !sound.isSpeechPlaying())
 			people._portrait._frameNumber = -1;
 
 		scene.doBgAnim();
@@ -976,10 +976,9 @@ int Talk::waitForMore(int delay) {
 		if ((delay > 0 && !ui._invLookFlag && !ui._lookScriptFlag) || _talkStealth)
 			--delay;
 
-		// If there are voices playing, reset delay so that they keep playing
-		if ((sound._voices == 2 && *sound._soundIsOn) || (playingSpeech && !sound.isSpeechPlaying()))
+		if (playingSpeech && !sound.isSpeechPlaying())
 			delay = 0;
-	} while (!_vm->shouldQuit() && key2 == 254 && (delay || (sound._voices == 2 && *sound._soundIsOn))
+	} while (!_vm->shouldQuit() && key2 == 254 && (delay || (playingSpeech && sound.isSpeechPlaying()))
 		&& !events._released && !events._rightReleased);
 
 	// If voices was set 2 to indicate a voice file was place, then reset it back to 1






More information about the Scummvm-git-logs mailing list