diff options
-rw-r--r-- | engines/sherlock/events.cpp | 6 | ||||
-rw-r--r-- | engines/sherlock/events.h | 4 | ||||
-rw-r--r-- | engines/sherlock/sherlock.h | 1 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_map.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_user_interface.cpp | 4 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_base.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_inventory.cpp | 7 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_tooltip.cpp | 3 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_verbs.cpp | 6 |
9 files changed, 19 insertions, 16 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index 490d30f698..3f49e347ae 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -196,12 +196,12 @@ bool Events::checkForNextFrameCounter() { return false; } -Common::Point Events::mousePos() const { +Common::Point Events::screenMousePos() const { return g_system->getEventManager()->getMousePos(); } -Common::Point Events::sceneMousePos() const { - return mousePos() + _vm->_screen->_currentScroll; +Common::Point Events::mousePos() const { + return screenMousePos() + _vm->_screen->_currentScroll; } Common::KeyState Events::getKey() { diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h index 052698a609..ffe6584ae6 100644 --- a/engines/sherlock/events.h +++ b/engines/sherlock/events.h @@ -127,12 +127,12 @@ public: /** * Get the current mouse position */ - Common::Point mousePos() const; + Common::Point screenMousePos() const; /** * Get the current mouse position within the scene, adjusted by the scroll position */ - Common::Point sceneMousePos() const; + Common::Point mousePos() const; /** * Return the current game frame number diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h index b0d0fa28c8..69000e1fbc 100644 --- a/engines/sherlock/sherlock.h +++ b/engines/sherlock/sherlock.h @@ -65,6 +65,7 @@ enum GameType { #define SHERLOCK_SCREEN_WIDTH _vm->_screen->w() #define SHERLOCK_SCREEN_HEIGHT _vm->_screen->h() +#define SHERLOCK_SCENE_WIDTH _vm->_screen->_backBuffer1.w() #define SHERLOCK_SCENE_HEIGHT (IS_SERRATED_SCALPEL ? 138 : 480) #define SCENES_COUNT (IS_SERRATED_SCALPEL ? 63 : 101) 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; |