From dee398ad6caf741d1bcd81d1a32b26d08ad066d7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 May 2011 20:47:56 +1000 Subject: TSAGE: Fixed problem with text being partly off-screen in Scene #9500 --- engines/tsage/converse.cpp | 12 +++++++----- engines/tsage/core.cpp | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 46ca557190..789ec8fa8d 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -349,17 +349,19 @@ void SequenceManager::setMessage(int resNum, int lineNum, int color, const Commo // Get the display message Common::String msg = _resourceManager->getMessage(resNum, lineNum); - // Get the needed rect, and move it to the desired position - Rect textRect; - _globals->gfxManager().getStringBounds(msg.c_str(), textRect, width); + // Set the text message + _sceneText.setup(msg); + + // Move the text to the correct position + Rect textRect = _sceneText._bounds; Rect sceneBounds = _globals->_sceneManager._scene->_sceneBounds; sceneBounds.collapse(4, 2); textRect.moveTo(pt); textRect.contain(sceneBounds); - // Set the text message - _sceneText.setup(msg); _sceneText.setPosition(Common::Point(textRect.left, textRect.top)); + + // Draw the text _sceneText.fixPriority(255); _sceneText.show(); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index da80111aa9..86219a7908 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2535,6 +2535,8 @@ void SceneText::setup(const Common::String &msg) { gfxMan._font._colors2.foreground = _color3; gfxMan.getStringBounds(msg.c_str(), textRect, _width); + _bounds.setWidth(textRect.width()); + _bounds.setHeight(textRect.height()); // Set up a new blank surface to hold the text _textSurface.create(textRect.width(), textRect.height()); -- cgit v1.2.3