diff options
author | strangerke | 2011-02-14 08:31:01 +0100 |
---|---|---|
committer | strangerke | 2011-02-14 08:31:01 +0100 |
commit | 97852d473e05b03a1b9a18facc9c2cf0c3ac8a92 (patch) | |
tree | 9464f15f7959007ebb8d3866319551c808350687 /engines/hugo/object.cpp | |
parent | fad3e645507030a2c34e4d6e5a37ec1bcd526105 (diff) | |
download | scummvm-rg350-97852d473e05b03a1b9a18facc9c2cf0c3ac8a92.tar.gz scummvm-rg350-97852d473e05b03a1b9a18facc9c2cf0c3ac8a92.tar.bz2 scummvm-rg350-97852d473e05b03a1b9a18facc9c2cf0c3ac8a92.zip |
HUGO: Some more refactoring
Move _hotspots to mouse class and encapsulate it, rename some variables in route class
Diffstat (limited to 'engines/hugo/object.cpp')
-rw-r--r-- | engines/hugo/object.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp index 1fa5293992..b909df45bb 100644 --- a/engines/hugo/object.cpp +++ b/engines/hugo/object.cpp @@ -44,6 +44,7 @@ #include "hugo/schedule.h" #include "hugo/text.h" #include "hugo/inventory.h" +#include "hugo/mouse.h" namespace Hugo { @@ -746,14 +747,10 @@ void ObjectHandler::boundaryCollision(object_t *obj) { x = obj->x + obj->currImagePtr->x1; int y = obj->y + obj->currImagePtr->y2; - for (int i = 0; _vm->_hotspots[i].screenIndex >= 0; i++) { - hotspot_t *hotspot = &_vm->_hotspots[i]; - if (hotspot->screenIndex == obj->screenIndex) - if ((x >= hotspot->x1) && (x <= hotspot->x2) && (y >= hotspot->y1) && (y <= hotspot->y2)) { - _vm->_scheduler->insertActionList(hotspot->actIndex); - break; - } - } + int16 index = _vm->_mouse->findExit(x, y, obj->screenIndex); + if (index >= 0) + _vm->_scheduler->insertActionList(_vm->_mouse->getHotspotActIndex(index)); + } else { // Check whether an object collided with HERO int dx = _vm->_hero->x + _vm->_hero->currImagePtr->x1 - obj->x - obj->currImagePtr->x1; |