[Scummvm-cvs-logs] scummvm master -> 3d20072fd894dc211cf1a8223b4c8e27b0aff1c2

dreammaster dreammaster at scummvm.org
Wed Jul 8 14:36:11 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:
3d20072fd8 SHERLOCK: RT: Fix display of inventory in scrolled scenes


Commit: 3d20072fd894dc211cf1a8223b4c8e27b0aff1c2
    https://github.com/scummvm/scummvm/commit/3d20072fd894dc211cf1a8223b4c8e27b0aff1c2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-08T08:35:03-04:00

Commit Message:
SHERLOCK: RT: Fix display of inventory in scrolled scenes

Changed paths:
    engines/sherlock/events.cpp
    engines/sherlock/events.h
    engines/sherlock/sherlock.h
    engines/sherlock/tattoo/tattoo_map.cpp
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/widget_base.cpp
    engines/sherlock/tattoo/widget_inventory.cpp
    engines/sherlock/tattoo/widget_tooltip.cpp
    engines/sherlock/tattoo/widget_verbs.cpp



diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 490d30f..3f49e34 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 052698a..ffe6584 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 b0d0fa2..69000e1 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 1a9aed7..6139518 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 7b2ef72..6eb0ca1 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 d946c46..cdebe69 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 3274552..3ce733b 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 80ac048..7e211bb 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 ec18e3c..81213b7 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;






More information about the Scummvm-git-logs mailing list