[Scummvm-cvs-logs] scummvm master -> 9cfe5c12968bdb53fb552615a354180b04778e29

dreammaster dreammaster at scummvm.org
Sat Jun 27 20:41:55 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:
9cfe5c1296 SHERLOCK: RT: Fix display of talk text windows


Commit: 9cfe5c12968bdb53fb552615a354180b04778e29
    https://github.com/scummvm/scummvm/commit/9cfe5c12968bdb53fb552615a354180b04778e29
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-27T14:40:51-04:00

Commit Message:
SHERLOCK: RT: Fix display of talk text windows

Changed paths:
    engines/sherlock/scene.cpp
    engines/sherlock/tattoo/tattoo_talk.cpp
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/tattoo_user_interface.h
    engines/sherlock/tattoo/widget_text.cpp



diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 3edac3c..e6a2762 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -286,6 +286,7 @@ void Scene::freeScene() {
 	if (_currentScene == -1)
 		return;
 
+	_vm->_ui->clearWindow();
 	_vm->_talk->freeTalkVars();
 	_vm->_inventory->freeInv();
 	_vm->_music->freeSong();
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 4868ef5..d7d85f4 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -184,7 +184,7 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm), _talkWidget(vm) {
 
 void TattooTalk::talkInterface(const byte *&str) {
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
-	const char *s = (const char *)str;
+	const byte *s = str;
 
 	// Move to past the end of the text string
 	_charCount = 0;
@@ -195,7 +195,7 @@ void TattooTalk::talkInterface(const byte *&str) {
 
 	// Display the text window
 	ui.banishWindow();
-	ui._textWidget.load(s, _speaker);
+	ui._textWidget.load(Common::String((const char *)s, (const char *)str), _speaker);
 	ui._textWidget.summonWindow();
 	_wait = true;
 }
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index e309875..ff98706 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -865,6 +865,10 @@ void TattooUserInterface::banishWindow() {
 	_widget = nullptr;
 }
 
+void TattooUserInterface::clearWindow() {
+	banishWindow();
+}
+
 } // End of namespace Tattoo
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.h b/engines/sherlock/tattoo/tattoo_user_interface.h
index 5b623e7..527f326 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.h
+++ b/engines/sherlock/tattoo/tattoo_user_interface.h
@@ -225,6 +225,11 @@ public:
 	 * Draw the user interface onto the screen's back buffers
 	 */	
 	virtual void drawInterface(int bufferNum = 3);
+
+	/**
+	 * Clear any active text window
+	 */
+	virtual void clearWindow();
 };
 
 } // End of namespace Tattoo
diff --git a/engines/sherlock/tattoo/widget_text.cpp b/engines/sherlock/tattoo/widget_text.cpp
index 5c2e7e0..dd696b1 100644
--- a/engines/sherlock/tattoo/widget_text.cpp
+++ b/engines/sherlock/tattoo/widget_text.cpp
@@ -152,6 +152,8 @@ void WidgetText::centerWindowOnSpeaker(int speaker) {
 			pt.y = SHERLOCK_SCREEN_HEIGHT / 2 - _bounds.height() / 2;
 		}
 	}
+
+	_bounds.moveTo(pt);
 }
 
 void WidgetText::render(const Common::String &str) {






More information about the Scummvm-git-logs mailing list