From 6862c9dd9bc03b0ce425c71c62f203d9ae996e8a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 21 Aug 2015 21:37:29 -0400 Subject: SHERLOCK: 3DO: Cleanup of conversation message playback The changes remove most of the hardcoding that was in place for showing the conversation movies, and have them triggered like the Rose Tattoo speech files. It will still need some work to hook it into our new voice playback, though, so text dialogs are closed at the right time --- engines/sherlock/scalpel/scalpel_talk.cpp | 4 ++-- engines/sherlock/scalpel/scalpel_talk.h | 2 +- engines/sherlock/talk.cpp | 20 ++++++-------------- engines/sherlock/talk.h | 3 ++- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index 6f98a17d1d..9b38a95c64 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -540,10 +540,10 @@ void ScalpelTalk::nothingToSay() { error("Character had no talk options available"); } -void ScalpelTalk::switchSpeaker(int subIndex) { +void ScalpelTalk::switchSpeaker() { // If it's the 3DO, pass on to start the actor's conversation movie if (IS_3DO) - talk3DOMovieTrigger(subIndex); + talk3DOMovieTrigger(_3doSpeechIndex++); } void ScalpelTalk::talk3DOMovieTrigger(int subIndex) { diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h index 9e07b26dc8..4d13258985 100644 --- a/engines/sherlock/scalpel/scalpel_talk.h +++ b/engines/sherlock/scalpel/scalpel_talk.h @@ -68,7 +68,7 @@ protected: /** * Called when the active speaker is switched */ - virtual void switchSpeaker(int subIndex); + virtual void switchSpeaker(); /** * Called when a character being spoken to has no talk options to display diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index fffb8308cc..dad6b411d5 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -113,6 +113,7 @@ Talk::Talk(SherlockEngine *vm) : _vm(vm) { _scriptSaveIndex = -1; _opcodes = nullptr; _opcodeTable = nullptr; + _3doSpeechIndex = -1; _charCount = 0; _line = 0; @@ -575,6 +576,8 @@ void Talk::loadTalkFile(const Common::String &filename) { // Create the base of the sound filename used for talking in Rose Tattoo if (IS_ROSE_TATTOO && _scriptMoreFlag != 1) sound._talkSoundFile = Common::String(filename.c_str(), filename.c_str() + 7) + "."; + else if (IS_3DO) + _3doSpeechIndex = 1; // Open the talk file for reading Common::SeekableReadStream *talkStream = res.load(talkFile); @@ -744,9 +747,6 @@ void Talk::doScript(const Common::String &script) { } } - bool speakerSwitched = true; - uint16 subIndex = 1; - do { Common::String tempString; _wait = 0; @@ -769,9 +769,6 @@ void Talk::doScript(const Common::String &script) { break; } - if (c == _opcodes[OP_SWITCH_SPEAKER]) - speakerSwitched = true; - ++str; } else { // Handle drawing the talk interface with the text @@ -790,12 +787,6 @@ void Talk::doScript(const Common::String &script) { _openTalkWindow = false; } - if ((_wait) && (speakerSwitched)) { - switchSpeaker(subIndex); - speakerSwitched = false; - ++subIndex; - } - if (_wait) // Handling pausing talkWait(str); @@ -839,11 +830,12 @@ int Talk::waitForMore(int delay) { } // Handle playing any speech associated with the text being displayed - if (IS_ROSE_TATTOO && sound._speechOn) { + switchSpeaker(); + if (sound._speechOn && IS_ROSE_TATTOO) { sound.playSpeech(sound._talkSoundFile); sound._talkSoundFile.setChar(sound._talkSoundFile.lastChar() + 1, sound._talkSoundFile.size() - 1); - playingSpeech = sound.isSpeechPlaying(); } + playingSpeech = sound.isSpeechPlaying(); do { if (IS_SERRATED_SCALPEL && sound._speechOn && !sound.isSpeechPlaying()) diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h index adb7aec5fc..694ac083b2 100644 --- a/engines/sherlock/talk.h +++ b/engines/sherlock/talk.h @@ -180,6 +180,7 @@ protected: int _talkStealth; int _talkToFlag; int _scriptSaveIndex; + int _3doSpeechIndex; // These fields are used solely by doScript, but are fields because all the script opcodes are // separate methods now, and need access to these fields @@ -252,7 +253,7 @@ protected: /** * Called when the active speaker is switched */ - virtual void switchSpeaker(int subIndex) {} + virtual void switchSpeaker() {} public: Common::Array _statements; bool _talkToAbort; -- cgit v1.2.3