[Scummvm-cvs-logs] scummvm master -> 989ba681bc06ecf0b7965916b36a0da7c99ee115

dreammaster dreammaster at scummvm.org
Sat Aug 1 03:44:31 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:
989ba681bc SHERLOCK: RT: Mousing over an NPC overrides any bg object at the same place


Commit: 989ba681bc06ecf0b7965916b36a0da7c99ee115
    https://github.com/scummvm/scummvm/commit/989ba681bc06ecf0b7965916b36a0da7c99ee115
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-31T21:43:35-04:00

Commit Message:
SHERLOCK: RT: Mousing over an NPC overrides any bg object at the same place

Changed paths:
    engines/sherlock/tattoo/tattoo_scene.cpp



diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index 13206f0..2e83796 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -748,21 +748,21 @@ int TattooScene::findBgShape(const Common::Point &pt) {
 		// New frame hasn't been drawn yet
 		return -1;
 
-
-	for (int idx = (int)_bgShapes.size() - 1; idx >= 0; --idx) {
+	int result = -1;
+	for (int idx = (int)_bgShapes.size() - 1; idx >= 0 && result == -1; --idx) {
 		Object &o = _bgShapes[idx];
 
 		if (o._type != INVALID && o._type != NO_SHAPE && o._type != HIDDEN && 
 				(o._aType <= PERSON || (ui._menuMode == LAB_MODE && o._aType == SOLID))) {
 			if (o.getNewBounds().contains(pt))
-				return idx;
+				result = idx;
 		} else if (o._type == NO_SHAPE) {
 			if (o.getNoShapeBounds().contains(pt))
-				return idx;
+				result = idx;
 		}
 	}
 
-	// If no shape found, so check whether a character is highlighted
+	// Now check for the mouse being over an NPC. If so, it overrides any found bg object
 	for (int idx = 1; idx < MAX_CHARACTERS; ++idx) {
 		Person &person = people[idx];
 
@@ -778,11 +778,11 @@ int TattooScene::findBgShape(const Common::Point &pt) {
 				- charRect.height());
 
 			if (charRect.contains(pt))
-				return 1000 + idx;
+				result = 1000 + idx;
 		}
 	}
 
-	return -1;
+	return result;
 }
 
 void TattooScene::synchronize(Serializer &s) {






More information about the Scummvm-git-logs mailing list