aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel/scalpel_scene.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-26 12:23:26 -0400
committerPaul Gilbert2015-07-26 12:23:26 -0400
commit86a33cf4280aec06a160716ead325342d17a9839 (patch)
treec9504ffec542ba6ec339bc081dae613de3a01c07 /engines/sherlock/scalpel/scalpel_scene.cpp
parent3217eab5391f9717370d5ae7122d4e4edb3ec2d6 (diff)
downloadscummvm-rg350-86a33cf4280aec06a160716ead325342d17a9839.tar.gz
scummvm-rg350-86a33cf4280aec06a160716ead325342d17a9839.tar.bz2
scummvm-rg350-86a33cf4280aec06a160716ead325342d17a9839.zip
SHERLOCK: RT: Correct order of precedence of shapes in findBgShape
Diffstat (limited to 'engines/sherlock/scalpel/scalpel_scene.cpp')
-rw-r--r--engines/sherlock/scalpel/scalpel_scene.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/sherlock/scalpel/scalpel_scene.cpp b/engines/sherlock/scalpel/scalpel_scene.cpp
index 9c36e84969..2f60cebefe 100644
--- a/engines/sherlock/scalpel/scalpel_scene.cpp
+++ b/engines/sherlock/scalpel/scalpel_scene.cpp
@@ -727,6 +727,27 @@ int ScalpelScene::closestZone(const Common::Point &pt) {
return zone;
}
+int ScalpelScene::findBgShape(const Common::Point &pt) {
+ if (!_doBgAnimDone)
+ // New frame hasn't been drawn yet
+ return -1;
+
+ for (int idx = (int)_bgShapes.size() - 1; idx >= 0; --idx) {
+ Object &o = _bgShapes[idx];
+ if (o._type != INVALID && o._type != NO_SHAPE && o._type != HIDDEN
+ && o._aType <= PERSON) {
+ if (o.getNewBounds().contains(pt))
+ return idx;
+ }
+ else if (o._type == NO_SHAPE) {
+ if (o.getNoShapeBounds().contains(pt))
+ return idx;
+ }
+ }
+
+ return -1;
+}
+
} // End of namespace Scalpel
} // End of namespace Sherlock