diff options
author | Paul Gilbert | 2015-08-07 06:52:58 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-07 06:52:58 -0400 |
commit | 2696be83c04ddb5042091a2c52db9ed9f4a4e439 (patch) | |
tree | 3260670b1d7a5cfd20a602eee38114887f139411 /engines/sherlock | |
parent | b573e0cf7af9bf194888a132ebe1a96d8deb9d25 (diff) | |
download | scummvm-rg350-2696be83c04ddb5042091a2c52db9ed9f4a4e439.tar.gz scummvm-rg350-2696be83c04ddb5042091a2c52db9ed9f4a4e439.tar.bz2 scummvm-rg350-2696be83c04ddb5042091a2c52db9ed9f4a4e439.zip |
SHERLOCK: SS: Cleaned up handling of 3DO portrait playback
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.cpp | 11 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.h | 10 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_user_interface.cpp | 8 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 18 | ||||
-rw-r--r-- | engines/sherlock/talk.h | 10 |
5 files changed, 32 insertions, 25 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index d85820e3dc..8261304675 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -537,12 +537,13 @@ void ScalpelTalk::talkWait(const byte *&str) { } } -void ScalpelTalk::talk3DOMovieTrigger(int subIndex) { - if (!IS_3DO) { - // No 3DO? No movie! - return; - } +void ScalpelTalk::switchSpeaker(int subIndex) { + // If it's the 3DO, pass on to start the actor's conversation movie + if (IS_3DO) + talk3DOMovieTrigger(subIndex); +} +void ScalpelTalk::talk3DOMovieTrigger(int subIndex) { // Find out a few things that we need int userSelector = _vm->_ui->_selector; int scriptSelector = _scriptSelect; diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h index dede117337..3ae36336df 100644 --- a/engines/sherlock/scalpel/scalpel_talk.h +++ b/engines/sherlock/scalpel/scalpel_talk.h @@ -63,10 +63,11 @@ protected: */ virtual void talkWait(const byte *&str); + /** - * Trigger to play a 3DO talk dialog movie + * Called when the active speaker is switched */ - virtual void talk3DOMovieTrigger(int subIndex); + virtual void switchSpeaker(int subIndex); /** * Show the talk display @@ -91,6 +92,11 @@ public: * Prints a single conversation option in the interface window */ int talkLine(int lineNum, int stateNum, byte color, int lineY, bool slamIt); + + /** + * Trigger to play a 3DO talk dialog movie + */ + void talk3DOMovieTrigger(int subIndex); }; } // End of namespace Scalpel diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 8fcc92b2ac..5fe8c74c1a 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -27,6 +27,7 @@ #include "sherlock/scalpel/scalpel_people.h" #include "sherlock/scalpel/scalpel_saveload.h" #include "sherlock/scalpel/scalpel_screen.h" +#include "sherlock/scalpel/scalpel_talk.h" #include "sherlock/scalpel/settings.h" #include "sherlock/scalpel/scalpel.h" #include "sherlock/sherlock.h" @@ -1483,7 +1484,7 @@ void ScalpelUserInterface::doTalkControl() { ScalpelPeople &people = *(ScalpelPeople *)_vm->_people; ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen; Sound &sound = *_vm->_sound; - Talk &talk = *_vm->_talk; + ScalpelTalk &talk = *(ScalpelTalk *)_vm->_talk; Common::Point mousePos = events.mousePos(); _key = _oldKey = -1; @@ -1645,8 +1646,9 @@ void ScalpelUserInterface::doTalkControl() { sound._speechOn = false; } - // Trigger to play 3DO movie - talk.talk3DOMovieTrigger(0); + if (IS_3DO) + // Trigger to play 3DO movie + talk.talk3DOMovieTrigger(0); talk.waitForMore(talk._statements[_selector]._statement.size()); if (talk._talkToAbort) diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 63bdc9044b..b347bd458d 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -823,7 +823,7 @@ void Talk::doScript(const Common::String &script) { } } - bool trigger3DOMovie = true; + bool speakerSwitched = true; uint16 subIndex = 1; do { @@ -844,13 +844,13 @@ void Talk::doScript(const Common::String &script) { return; case RET_CONTINUE: continue; - case OP_SWITCH_SPEAKER: - trigger3DOMovie = true; - break; default: break; } + if (c == _opcodes[OP_SWITCH_SPEAKER]) + speakerSwitched = true; + ++str; } else { // Handle drawing the talk interface with the text @@ -869,12 +869,10 @@ void Talk::doScript(const Common::String &script) { _openTalkWindow = false; } - if ((_wait) && (trigger3DOMovie)) { - // Trigger to play 3DO movie - talk3DOMovieTrigger(subIndex); - - trigger3DOMovie = false; // wait for next switch speaker opcode - subIndex++; + if ((_wait) && (speakerSwitched)) { + switchSpeaker(subIndex); + speakerSwitched = false; + ++subIndex; } if (_wait) diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h index 8364bbf6dd..2f7f2d0c42 100644 --- a/engines/sherlock/talk.h +++ b/engines/sherlock/talk.h @@ -251,14 +251,14 @@ protected: virtual void talkWait(const byte *&str); /** - * Trigger to play a 3DO talk dialog movie - */ - virtual void talk3DOMovieTrigger(int subIndex) {}; - - /** * Show the talk display */ virtual void showTalk() = 0; + + /** + * Called when the active speaker is switched + */ + virtual void switchSpeaker(int subIndex) {} public: TalkSequence _talkSequenceStack[TALK_SEQUENCE_STACK_SIZE]; Common::Array<Statement> _statements; |