[Scummvm-cvs-logs] scummvm master -> 169f4b94f2e0999b5825e3328fafa7960df18659
dreammaster
dreammaster at scummvm.org
Fri Jul 3 02:14:16 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:
169f4b94f2 SHERLOCK: RT: Fix looking at characters
Commit: 169f4b94f2e0999b5825e3328fafa7960df18659
https://github.com/scummvm/scummvm/commit/169f4b94f2e0999b5825e3328fafa7960df18659
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-02T20:13:21-04:00
Commit Message:
SHERLOCK: RT: Fix looking at characters
Changed paths:
engines/sherlock/tattoo/tattoo_user_interface.cpp
engines/sherlock/tattoo/widget_base.cpp
engines/sherlock/tattoo/widget_base.h
engines/sherlock/tattoo/widget_inventory.cpp
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 8942d4e..93290c6 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -63,13 +63,18 @@ void TattooUserInterface::initScrollVars() {
}
void TattooUserInterface::lookAtObject() {
+ Events &events = *_vm->_events;
People &people = *_vm->_people;
Scene &scene = *_vm->_scene;
Sound &sound = *_vm->_sound;
Talk &talk = *_vm->_talk;
+ Common::Point mousePos = events.mousePos();
Common::String desc;
int cAnimSpeed = 0;
+ _lookPos = mousePos;
+ _menuMode = LOOK_MODE;
+
if (_personFound) {
desc = people[_bgFound - 1000]._examine;
} else {
@@ -184,6 +189,7 @@ void TattooUserInterface::printObjectDesc(const Common::String &str, bool firstT
// Show text dialog
_textWidget.load(str);
+ _textWidget.summonWindow();
if (firstTime)
_selector = _oldSelector = -1;
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 0a53c55..00bc83d 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -76,7 +76,9 @@ void WidgetBase::draw() {
if (_bounds.width() > 0 && !_surface.empty()) {
// Get the area to draw, adjusted for scroll position
+ restrictToScreen();
Common::Rect bounds = _bounds;
+
bounds.translate(currentScroll.x, currentScroll.y);
// Draw the background for the widget
@@ -148,7 +150,7 @@ Common::String WidgetBase::splitLines(const Common::String &str, Common::StringA
return *strP ? Common::String(strP) : Common::String();
}
-void WidgetBase::checkMenuPosition() {
+void WidgetBase::restrictToScreen() {
if (_bounds.left < 0)
_bounds.moveTo(0, _bounds.top);
if (_bounds.top < 0)
diff --git a/engines/sherlock/tattoo/widget_base.h b/engines/sherlock/tattoo/widget_base.h
index f5ac2ea..3bf3095 100644
--- a/engines/sherlock/tattoo/widget_base.h
+++ b/engines/sherlock/tattoo/widget_base.h
@@ -51,7 +51,7 @@ protected:
/**
* Ensure that menu is drawn entirely on-screen
*/
- void checkMenuPosition();
+ void restrictToScreen();
/**
* Draw a window frame around the dges of the passed surface
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 1b4fa69..1df0e99 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -287,7 +287,7 @@ void WidgetInventory::load(int mode) {
}
// Ensure menu will be on-screen
- checkMenuPosition();
+ restrictToScreen();
// Load the inventory data
inv.loadInv();
More information about the Scummvm-git-logs
mailing list