aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-13 18:43:51 -0400
committerPaul Gilbert2015-08-13 18:43:51 -0400
commite02965c40a607209cc7a46b78cfeab21b0e292da (patch)
tree632ee260ff3356813d94cb23d4cb643cfe64506e /engines/sherlock
parent336abef4012d359759a607f10138352cdae514c7 (diff)
downloadscummvm-rg350-e02965c40a607209cc7a46b78cfeab21b0e292da.tar.gz
scummvm-rg350-e02965c40a607209cc7a46b78cfeab21b0e292da.tar.bz2
scummvm-rg350-e02965c40a607209cc7a46b78cfeab21b0e292da.zip
SHERLOCK: RT: SImplification of old speech code
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp3
-rw-r--r--engines/sherlock/scalpel/scalpel_user_interface.cpp5
-rw-r--r--engines/sherlock/sound.cpp9
-rw-r--r--engines/sherlock/sound.h2
-rw-r--r--engines/sherlock/talk.cpp7
5 files changed, 11 insertions, 15 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 80e9b79364..2fd9ede763 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 5fe8c74c1a..f948b786e7 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 c9b30b142a..f8d07e5806 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 3894d16c7c..c71a29c3f4 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 ab8eed8892..7811aa3b55 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