Skip to content

Commit

Permalink
SHERLOCK: RT: Fix display of talk text windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 27, 2015
1 parent 8faef1c commit 9cfe5c1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions engines/sherlock/scene.cpp
Expand Up @@ -286,6 +286,7 @@ void Scene::freeScene() {
if (_currentScene == -1)
return;

_vm->_ui->clearWindow();
_vm->_talk->freeTalkVars();
_vm->_inventory->freeInv();
_vm->_music->freeSong();
Expand Down
4 changes: 2 additions & 2 deletions engines/sherlock/tattoo/tattoo_talk.cpp
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions engines/sherlock/tattoo/tattoo_user_interface.cpp
Expand Up @@ -865,6 +865,10 @@ void TattooUserInterface::banishWindow() {
_widget = nullptr;
}

void TattooUserInterface::clearWindow() {
banishWindow();
}

} // End of namespace Tattoo

} // End of namespace Sherlock
5 changes: 5 additions & 0 deletions engines/sherlock/tattoo/tattoo_user_interface.h
Expand Up @@ -225,6 +225,11 @@ class TattooUserInterface : public UserInterface {
* 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
Expand Down
2 changes: 2 additions & 0 deletions engines/sherlock/tattoo/widget_text.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 9cfe5c1

Please sign in to comment.