diff options
author | Strangerke | 2016-05-12 20:33:51 +0200 |
---|---|---|
committer | Strangerke | 2016-05-12 20:33:51 +0200 |
commit | 55162fb7ca2accfee74a6eb57cadfbf57962c161 (patch) | |
tree | 314269a9407fb05131132d3689f8e7a411d7889e /engines | |
parent | 9c0808237c3c4cb8a93a31cad8bf939396415fd1 (diff) | |
download | scummvm-rg350-55162fb7ca2accfee74a6eb57cadfbf57962c161.tar.gz scummvm-rg350-55162fb7ca2accfee74a6eb57cadfbf57962c161.tar.bz2 scummvm-rg350-55162fb7ca2accfee74a6eb57cadfbf57962c161.zip |
GNAP: Simplify some calls of _hotspotWalkPos
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gnap/gnap.cpp | 3 | ||||
-rw-r--r-- | engines/gnap/scenes/group0.cpp | 4 | ||||
-rw-r--r-- | engines/gnap/scenes/group1.cpp | 6 |
3 files changed, 5 insertions, 8 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index 3b5d1496e0..dacf360eda 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -326,8 +326,7 @@ void GnapEngine::setHotspot(int index, int16 x1, int16 y1, int16 x2, int16 y2, u int16 walkX, int16 walkY) { _hotspots[index]._rect = Common::Rect(x1, y1, x2, y2); _hotspots[index]._flags = flags; - _hotspotsWalkPos[index].x = walkX; - _hotspotsWalkPos[index].y = walkY; + _hotspotsWalkPos[index] = Common::Point(walkX, walkY); } int GnapEngine::getHotspotIndexAtPos(Common::Point pos) { diff --git a/engines/gnap/scenes/group0.cpp b/engines/gnap/scenes/group0.cpp index 1b82faccfb..c7792af531 100644 --- a/engines/gnap/scenes/group0.cpp +++ b/engines/gnap/scenes/group0.cpp @@ -508,7 +508,7 @@ void Scene02::run() { if (gnap._actionStatus < 0) { if (_vm->_grabCursorSpriteIndex == kItemTwig) { gnap._idleFacing = kDirUpRight; - Common::Point destPos = Common::Point(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y + 1); + Common::Point destPos = _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot] + Common::Point(0, 1); gnap.walkTo(destPos, 0, gnap.getSequenceId(kGSIdle, Common::Point(0, 0)) | 0x10000, 1); gnap._actionStatus = kAS02UseTwigWithChicken; } else if (_vm->_grabCursorSpriteIndex >= 0) { @@ -1967,7 +1967,7 @@ void Scene05::run() { } else { switch (_vm->_verbCursor) { case LOOK_CURSOR: - gnap.playScratchingHead(Common::Point(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y - 1)); + gnap.playScratchingHead(_vm->_hotspotsWalkPos[1] + Common::Point(0, -1)); break; case GRAB_CURSOR: case TALK_CURSOR: diff --git a/engines/gnap/scenes/group1.cpp b/engines/gnap/scenes/group1.cpp index 7aa5d9efdd..f785c443f1 100644 --- a/engines/gnap/scenes/group1.cpp +++ b/engines/gnap/scenes/group1.cpp @@ -3147,8 +3147,7 @@ void Scene18::updateHotspots() { _vm->_hotspots[kHS18HydrantRightValve]._rect.left = 148; _vm->_hotspots[kHS18HydrantRightValve]._rect.top = 403; _vm->_hotspots[kHS18GarbageCan]._flags = SF_DISABLED; - _vm->_hotspotsWalkPos[kHS18GarbageCan].x = 3; - _vm->_hotspotsWalkPos[kHS18GarbageCan].y = 7; + _vm->_hotspotsWalkPos[kHS18GarbageCan] = Common::Point(3, 7); } else { _vm->_hotspots[kHS18HydrantTopValve]._rect.top = 246; } @@ -3159,8 +3158,7 @@ void Scene18::updateHotspots() { } else if (_vm->isFlag(kGFTruckKeysUsed)) { _vm->_hotspots[kHS18GarbageCan]._rect = Common::Rect(115, 365, 168, 470); _vm->_hotspots[kHS18GarbageCan]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR; - _vm->_hotspotsWalkPos[kHS18GarbageCan].x = 3; - _vm->_hotspotsWalkPos[kHS18GarbageCan].y = 7; + _vm->_hotspotsWalkPos[kHS18GarbageCan] = Common::Point(3, 7); } if (_vm->isFlag(kGFPlatypusDisguised)) _vm->_hotspots[kHS18GarbageCan]._flags = SF_DISABLED; |