[Scummvm-cvs-logs] scummvm master -> 2696be83c04ddb5042091a2c52db9ed9f4a4e439

dreammaster dreammaster at scummvm.org
Fri Aug 7 12:53:52 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:
2696be83c0 SHERLOCK: SS: Cleaned up handling of 3DO portrait playback


Commit: 2696be83c04ddb5042091a2c52db9ed9f4a4e439
    https://github.com/scummvm/scummvm/commit/2696be83c04ddb5042091a2c52db9ed9f4a4e439
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-07T06:52:58-04:00

Commit Message:
SHERLOCK: SS: Cleaned up handling of 3DO portrait playback

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



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index d85820e..8261304 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 dede117..3ae3633 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 8fcc92b..5fe8c74 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 63bdc90..b347bd4 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 8364bbf..2f7f2d0 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;






More information about the Scummvm-git-logs mailing list