diff options
Diffstat (limited to 'engines/sherlock/scalpel/scalpel_scene.cpp')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_scene.cpp | 21 |
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 |