aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-19 18:56:08 -0400
committerPaul Gilbert2015-07-19 18:56:08 -0400
commit48f5ef847fed6ef97a92c059f8f93bd453051144 (patch)
treec8991dbf705ee1e1270335387f5d6f5c652c2981 /engines
parent23471eeb5306548878aedf75524ffba0af94cd61 (diff)
downloadscummvm-rg350-48f5ef847fed6ef97a92c059f8f93bd453051144.tar.gz
scummvm-rg350-48f5ef847fed6ef97a92c059f8f93bd453051144.tar.bz2
scummvm-rg350-48f5ef847fed6ef97a92c059f8f93bd453051144.zip
SHERLOCK: RT: Fix tooltip display when using inventory item
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/events.cpp2
-rw-r--r--engines/sherlock/events.h1
-rw-r--r--engines/sherlock/tattoo/widget_inventory.cpp4
3 files changed, 7 insertions, 0 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index c57abc7291..a8912f6f1e 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -89,6 +89,8 @@ void Events::setCursor(CursorId cursorId) {
void Events::setCursor(const Graphics::Surface &src, int hotspotX, int hotspotY) {
_cursorId = INVALID_CURSOR;
+ _hotspotPos = Common::Point(hotspotX, hotspotY);
+
if (!IS_3DO) {
// PC 8-bit palettized
CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0xff);
diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h
index 6932f21c98..93a5e54f81 100644
--- a/engines/sherlock/events.h
+++ b/engines/sherlock/events.h
@@ -59,6 +59,7 @@ public:
bool _oldRightButton;
bool _firstPress;
Common::Stack<Common::KeyState> _pendingKeys;
+ Common::Point _hotspotPos;
public:
Events(SherlockEngine *vm);
~Events();
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 52ab5bf23f..9afe841fa9 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -230,6 +230,10 @@ void WidgetInventoryTooltip::handleEvents() {
return;
}
+ if (_owner->_invVerbMode == 3)
+ // Adjust tooltip to be above the inventory item being shown above the standard cursor
+ mousePos.y -= events._hotspotPos.y;
+
// Update the position of the tooltip
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());