[Scummvm-cvs-logs] scummvm master -> 62406c81b700bdf15451bc863be5fbf6e4cbd841

dreammaster dreammaster at scummvm.org
Sat Aug 8 04:21:06 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:
62406c81b7 SHERLOCK: RT: Fix display when characters have nothing to say


Commit: 62406c81b700bdf15451bc863be5fbf6e4cbd841
    https://github.com/scummvm/scummvm/commit/62406c81b700bdf15451bc863be5fbf6e4cbd841
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-07T22:20:03-04:00

Commit Message:
SHERLOCK: RT: Fix display when characters have nothing to say

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
    engines/sherlock/tattoo/widget_talk.cpp



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 8261304..80e9b79 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -537,6 +537,10 @@ void ScalpelTalk::talkWait(const byte *&str) {
 	}
 }
 
+void ScalpelTalk::nothingToSay() {
+	error("Character had no talk options available");
+}
+
 void ScalpelTalk::switchSpeaker(int subIndex) {
 	// If it's the 3DO, pass on to start the actor's conversation movie
 	if (IS_3DO)
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 3ae3633..7ef6705 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -63,13 +63,17 @@ protected:
 	 */
 	virtual void talkWait(const byte *&str);
 
-
 	/**
 	 * Called when the active speaker is switched
 	 */
 	virtual void switchSpeaker(int subIndex);
 
 	/**
+	 * Called when a character being spoken to has no talk options to display
+	 */
+	virtual void nothingToSay();
+
+	/**
 	 * Show the talk display
 	 */
 	virtual void showTalk();
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 83596e4..1b12c6a 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -468,8 +468,15 @@ void Talk::talk(int objNum) {
 			break;
 		}
 	}
-	if (select == -1)
-		error("No entry matched all required flags");
+
+	if (select == -1) {
+		freeTalkVars();
+		if (!scumm_strnicmp(talkFilename.c_str(), "PATH", 4))
+			error("No entries found to execute in path file");
+
+		nothingToSay();
+		return;
+	}
 
 	// See if the statement is a stealth mode reply
 	Statement &statement = _statements[select];
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index 2f7f2d0..767c7c8 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -256,6 +256,11 @@ protected:
 	virtual void showTalk() = 0;
 
 	/**
+	 * Called when a character being spoken to has no talk options to display
+	 */
+	virtual void nothingToSay() = 0;
+
+	/**
 	 * Called when the active speaker is switched
 	 */
 	virtual void switchSpeaker(int subIndex) {}
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 7762b48..ee6856c 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/tattoo/tattoo_talk.h"
+#include "sherlock/tattoo/tattoo_fixed_text.h"
 #include "sherlock/tattoo/tattoo_people.h"
 #include "sherlock/tattoo/tattoo_scene.h"
 #include "sherlock/tattoo/tattoo_user_interface.h"
@@ -200,6 +201,11 @@ void TattooTalk::talkInterface(const byte *&str) {
 	_wait = true;
 }
 
+void TattooTalk::nothingToSay() {
+	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+	ui.putMessage("%s", FIXED(NothingToSay));
+}
+
 void TattooTalk::showTalk() {
 	TattooPeople &people = *(TattooPeople *)_vm->_people;
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index 64a329e..cd96183 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -87,6 +87,11 @@ protected:
 	virtual void talkInterface(const byte *&str);
 
 	/**
+	 * Called when a character being spoken to has no talk options to display
+	 */
+	virtual void nothingToSay();
+
+	/**
 	 * Show the talk display
 	 */
 	virtual void showTalk();
diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp
index d33da65..dfb2360 100644
--- a/engines/sherlock/tattoo/widget_talk.cpp
+++ b/engines/sherlock/tattoo/widget_talk.cpp
@@ -311,7 +311,7 @@ void WidgetTalk::handleEvents() {
 
 						if (select == -1) {
 							talk.freeTalkVars();
-							ui.putMessage("%s", FIXED(NothingToSay));
+							talk.nothingToSay();
 							return;
 						}
 






More information about the Scummvm-git-logs mailing list