aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-08 08:35:03 -0400
committerPaul Gilbert2015-07-08 08:35:03 -0400
commit3d20072fd894dc211cf1a8223b4c8e27b0aff1c2 (patch)
treee5a0ccf91a97e6f1f10a7d6fdf2a471b283df701 /engines/sherlock/tattoo
parent08414cfaed5554796a0ea94c66f7e50a03395797 (diff)
downloadscummvm-rg350-3d20072fd894dc211cf1a8223b4c8e27b0aff1c2.tar.gz
scummvm-rg350-3d20072fd894dc211cf1a8223b4c8e27b0aff1c2.tar.bz2
scummvm-rg350-3d20072fd894dc211cf1a8223b4c8e27b0aff1c2.zip
SHERLOCK: RT: Fix display of inventory in scrolled scenes
Diffstat (limited to 'engines/sherlock/tattoo')
-rw-r--r--engines/sherlock/tattoo/tattoo_map.cpp2
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp4
-rw-r--r--engines/sherlock/tattoo/widget_base.cpp2
-rw-r--r--engines/sherlock/tattoo/widget_inventory.cpp7
-rw-r--r--engines/sherlock/tattoo/widget_tooltip.cpp3
-rw-r--r--engines/sherlock/tattoo/widget_verbs.cpp6
6 files changed, 13 insertions, 11 deletions
diff --git a/engines/sherlock/tattoo/tattoo_map.cpp b/engines/sherlock/tattoo/tattoo_map.cpp
index 1a9aed7623..613951889c 100644
--- a/engines/sherlock/tattoo/tattoo_map.cpp
+++ b/engines/sherlock/tattoo/tattoo_map.cpp
@@ -305,7 +305,7 @@ void TattooMap::drawMapIcons() {
void TattooMap::checkMapNames(bool slamIt) {
Events &events = *_vm->_events;
- Common::Point mapPos = events.sceneMousePos();
+ Common::Point mapPos = events.mousePos();
// See if the mouse is pointing at any of the map locations
_bgFound = -1;
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 7b2ef7206d..6eb0ca1330 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -230,7 +230,7 @@ void TattooUserInterface::handleInput() {
TattooEngine &vm = *(TattooEngine *)_vm;
Events &events = *_vm->_events;
TattooScene &scene = *(TattooScene *)_vm->_scene;
- Common::Point mousePos = events.sceneMousePos();
+ Common::Point mousePos = events.mousePos();
events.pollEventsAndWait();
_keyState.keycode = Common::KEYCODE_INVALID;
@@ -531,7 +531,7 @@ void TattooUserInterface::doLabControl() {
void TattooUserInterface::displayObjectNames() {
Events &events = *_vm->_events;
Scene &scene = *_vm->_scene;
- Common::Point mousePos = events.sceneMousePos();
+ Common::Point mousePos = events.mousePos();
_arrowZone = -1;
if (_bgFound == -1 || scene._currentScene == 90) {
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index d946c46e4c..cdebe698aa 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -245,7 +245,7 @@ void WidgetBase::drawScrollBar(int index, int pageSize, int count) {
void WidgetBase::handleScrollbarEvents(int index, int pageSize, int count) {
Events &events = *_vm->_events;
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
- Common::Point mousePos = events.sceneMousePos();
+ Common::Point mousePos = events.mousePos();
// If they have selected the sollbar, return with the Scroll Bar Still selected
if (ui._scrollHighlight == 3)
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 3274552f5e..3ce733b3d6 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -127,7 +127,7 @@ void WidgetInventoryTooltip::handleEvents() {
_oldInvGraphicBounds = _invGraphicBounds;
// Set the New position of the graphic
- int xp = CLIP(mousePos.x - _invGraphicBounds.width() / 2, 0, SHERLOCK_SCREEN_WIDTH - _invGraphicBounds.width());
+ int xp = CLIP(mousePos.x - _invGraphicBounds.width() / 2, 0, SHERLOCK_SCENE_WIDTH - _invGraphicBounds.width());
int yp = CLIP(mousePos.y - _invGraphicBounds.height() / 2, 0, SHERLOCK_SCREEN_HEIGHT - _invGraphicBounds.height());
_invGraphicBounds.moveTo(xp, yp);
@@ -242,7 +242,7 @@ void WidgetInventoryTooltip::handleEvents() {
}
// Update the position of the tooltip
- int xs = CLIP(mousePos.x - _bounds.width() / 2, 0, SHERLOCK_SCREEN_WIDTH - _bounds.width());
+ int xs = CLIP(mousePos.x - _bounds.width() / 2, 0, SHERLOCK_SCENE_WIDTH - _bounds.width());
int ys = CLIP(mousePos.y - _bounds.height(), 0, SHERLOCK_SCREEN_HEIGHT - _bounds.height());
_bounds.moveTo(xs, ys);
}
@@ -263,11 +263,12 @@ WidgetInventory::WidgetInventory(SherlockEngine *vm) : WidgetBase(vm), _tooltipW
void WidgetInventory::load(int mode) {
Events &events = *_vm->_events;
Inventory &inv = *_vm->_inventory;
+ Screen &screen = *_vm->_screen;
Common::Point mousePos = events.mousePos();
if (mode == 3) {
mode = 2;
- mousePos = Common::Point(SHERLOCK_SCREEN_WIDTH / 2, SHERLOCK_SCREEN_HEIGHT / 2);
+ mousePos = Common::Point(screen._currentScroll.x + SHERLOCK_SCREEN_WIDTH / 2, SHERLOCK_SCREEN_HEIGHT / 2);
}
if (mode != 0)
diff --git a/engines/sherlock/tattoo/widget_tooltip.cpp b/engines/sherlock/tattoo/widget_tooltip.cpp
index 80ac048874..7e211bbe9f 100644
--- a/engines/sherlock/tattoo/widget_tooltip.cpp
+++ b/engines/sherlock/tattoo/widget_tooltip.cpp
@@ -44,7 +44,8 @@ void WidgetTooltipBase::draw() {
// Draw the widget directly onto the screen. Unlike other widgets, we don't draw to the back buffer,
// since nothing should be drawing on top of tooltips, so there's no need to store in the back buffer
- screen.transBlitFrom(_surface, Common::Point(_bounds.left, _bounds.top));
+ screen.transBlitFrom(_surface, Common::Point(_bounds.left - screen._currentScroll.x,
+ _bounds.top - screen._currentScroll.y));
// Store a copy of the drawn area for later erasing
_oldBounds = _bounds;
diff --git a/engines/sherlock/tattoo/widget_verbs.cpp b/engines/sherlock/tattoo/widget_verbs.cpp
index ec18e3ce05..81213b763a 100644
--- a/engines/sherlock/tattoo/widget_verbs.cpp
+++ b/engines/sherlock/tattoo/widget_verbs.cpp
@@ -41,7 +41,7 @@ void WidgetVerbs::load(bool objectsOn) {
TattooPeople &people = *(TattooPeople *)_vm->_people;
Talk &talk = *_vm->_talk;
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
- Common::Point mousePos = events.sceneMousePos();
+ Common::Point mousePos = events.mousePos();
bool isWatson = false;
if (talk._talkToAbort)
@@ -155,7 +155,7 @@ void WidgetVerbs::handleEvents() {
TattooScene &scene = *(TattooScene *)_vm->_scene;
Talk &talk = *_vm->_talk;
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
- Common::Point mousePos = events.sceneMousePos();
+ Common::Point mousePos = events.mousePos();
bool noDesc = false;
Common::String strLook = fixedText.getText(kFixedText_Look);
@@ -283,7 +283,7 @@ void WidgetVerbs::handleEvents() {
void WidgetVerbs::highlightVerbControls() {
Events &events = *_vm->_events;
Screen &screen = *_vm->_screen;
- Common::Point mousePos = events.sceneMousePos();
+ Common::Point mousePos = events.mousePos();
// Get highlighted verb
_selector = -1;