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

dreammaster dreammaster at scummvm.org
Thu Aug 27 14:56:00 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:
ca3050c912 SHERLOCK: RT: Fix previous commit, and make talkTo virtual


Commit: ca3050c9121938a05b33517f9e6672ee1e80b11f
    https://github.com/scummvm/scummvm/commit/ca3050c9121938a05b33517f9e6672ee1e80b11f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-27T08:55:27-04:00

Commit Message:
SHERLOCK: RT: Fix previous commit, and make talkTo virtual

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



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 9b38a95..69d1421 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -171,6 +171,18 @@ ScalpelTalk::ScalpelTalk(SherlockEngine *vm) : Talk(vm) {
 
 }
 
+void ScalpelTalk::talkTo(const Common::String filename) {
+	ScalpelUserInterface &ui = *(ScalpelUserInterface *)_vm->_ui;
+
+	Talk::talkTo(filename);
+
+	if (filename == "Tube59c") {
+		// WORKAROUND: Original game bug causes the results of testing the powdery substance
+		// to disappear too quickly. Introduce a delay to allow it to be properly displayed
+		ui._menuCounter = 30;
+	}
+}
+
 void ScalpelTalk::talkInterface(const byte *&str) {
 	FixedText &fixedText = *_vm->_fixedText;
 	People &people = *_vm->_people;
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 4d13258..31f78cb 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -84,6 +84,16 @@ public:
 	virtual ~ScalpelTalk() {}
 
 	/**
+	 * Called whenever a conversation or item script needs to be run. For standard conversations,
+	 * it opens up a description window similar to how 'talk' does, but shows a 'reply' directly
+	 * instead of waiting for a statement option.
+	 * @remarks		It seems that at some point, all item scripts were set up to use this as well.
+	 *	In their case, the conversation display is simply suppressed, and control is passed on to
+	 *	doScript to implement whatever action is required.
+	 */
+	virtual void talkTo(const Common::String filename);
+
+	/**
 	 * Draws the interface for conversation display
 	 */
 	void drawInterface();
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index d0c74f8..b31a273 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -127,7 +127,7 @@ Talk::Talk(SherlockEngine *vm) : _vm(vm) {
 	_talkHistory.resize(IS_ROSE_TATTOO ? 1500 : 500);
 }
 
-void Talk::talkTo(const Common::String &filename) {
+void Talk::talkTo(const Common::String filename) {
 	Events &events = *_vm->_events;
 	Inventory &inv = *_vm->_inventory;
 	Journal &journal = *_vm->_journal;
@@ -440,12 +440,6 @@ void Talk::talkTo(const Common::String &filename) {
 	// previous script can continue
 	popStack();
 
-	if (IS_SERRATED_SCALPEL && filename == "Tube59c") {
-		// WORKAROUND: Original game bug causes the results of testing the powdery substance
-		// to disappear too quickly. Introduce a delay to allow it to be properly displayed
-		ui._menuCounter = 30;
-	}
-
 	events.setCursor(ARROW);
 }
 
@@ -647,7 +641,7 @@ void Talk::pushSequence(int speaker) {
 	}
 }
 
-void Talk::doScript(const Common::String script) {
+void Talk::doScript(const Common::String &script) {
 	People &people = *_vm->_people;
 	Scene &scene = *_vm->_scene;
 	Screen &screen = *_vm->_screen;
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index b3868d7..a22a39d 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -283,13 +283,13 @@ public:
 	 *	In their case, the conversation display is simply suppressed, and control is passed on to
 	 *	doScript to implement whatever action is required.
 	 */
-	void talkTo(const Common::String &filename);
+	virtual void talkTo(const Common::String filename);
 
 	/**
 	 * Parses a reply for control codes and display text. The found text is printed within
 	 * the text window, handles delays, animations, and animating portraits.
 	 */
-	void doScript(const Common::String script);
+	void doScript(const Common::String &script);
 
 	/**
 	 * Main method for handling conversations when a character to talk to has been
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index a341115..7c57605 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -183,6 +183,10 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm), _talkWidget(vm), _passwor
 	_opcodeTable = OPCODE_METHODS;
 }
 
+void TattooTalk::talkTo(const Common::String filename) {
+	Talk::talkTo(filename);
+}
+
 void TattooTalk::talkInterface(const byte *&str) {
 	TattooEngine &vm = *(TattooEngine *)_vm;
 	Sound &sound = *_vm->_sound;
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index d2ddda0..9b01051 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -103,6 +103,16 @@ protected:
 public:
 	TattooTalk(SherlockEngine *vm);
 	virtual ~TattooTalk() {}
+	
+	/**
+	 * Called whenever a conversation or item script needs to be run. For standard conversations,
+	 * it opens up a description window similar to how 'talk' does, but shows a 'reply' directly
+	 * instead of waiting for a statement option.
+	 * @remarks		It seems that at some point, all item scripts were set up to use this as well.
+	 *	In their case, the conversation display is simply suppressed, and control is passed on to
+	 *	doScript to implement whatever action is required.
+	 */
+	virtual void talkTo(const Common::String filename);
 
 	/**
 	 * Push the details of a passed object onto the saved sequences stack






More information about the Scummvm-git-logs mailing list