diff options
Diffstat (limited to 'engines/sherlock/scene.cpp')
-rw-r--r-- | engines/sherlock/scene.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index 2f8762e7bd..e56561fb5f 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -1338,7 +1338,7 @@ Exit *Scene::checkForExit(const Common::Rect &r) { return nullptr; } -int Scene::findBgShape(const Common::Rect &r) { +int Scene::findBgShape(const Common::Point &pt) { if (!_doBgAnimDone) // New frame hasn't been drawn yet return -1; @@ -1347,10 +1347,10 @@ int Scene::findBgShape(const Common::Rect &r) { Object &o = _bgShapes[idx]; if (o._type != INVALID && o._type != NO_SHAPE && o._type != HIDDEN && o._aType <= PERSON) { - if (r.intersects(o.getNewBounds())) + if (o.getNewBounds().contains(pt)) return idx; } else if (o._type == NO_SHAPE) { - if (r.intersects(o.getNoShapeBounds())) + if (o.getNoShapeBounds().contains(pt)) return idx; } } @@ -1358,10 +1358,6 @@ int Scene::findBgShape(const Common::Rect &r) { return -1; } -int Scene::findBgShape(const Common::Point &pt) { - return findBgShape(Common::Rect(pt.x, pt.y, pt.x + 1, pt.y + 1)); -} - int Scene::checkForZones(const Common::Point &pt, int zoneType) { int matches = 0; |