diff options
-rw-r--r-- | engines/parallaction/callables.cpp | 14 | ||||
-rw-r--r-- | engines/parallaction/zone.h | 7 |
2 files changed, 9 insertions, 12 deletions
diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables.cpp index 8768c21da6..570e7796ef 100644 --- a/engines/parallaction/callables.cpp +++ b/engines/parallaction/callables.cpp @@ -138,18 +138,8 @@ void _c_moveSarc(void *parm) { } _introSarcData2 = 1; - - _moveSarcZone1->_right += _introSarcData1; - _moveSarcZone1->_left += _introSarcData1; - - _moveSarcZone1->_top -= (_introSarcData1 / 20); - _moveSarcZone1->_bottom -= (_introSarcData1 / 20); - - _moveSarcZone0->_right += _introSarcData1; - _moveSarcZone0->_left += _introSarcData1; - - _moveSarcZone0->_top -= (_introSarcData1 / 20); - _moveSarcZone0->_bottom -= (_introSarcData1 / 20); + _moveSarcZone1->translate(_introSarcData1, -_introSarcData1 / 20); + _moveSarcZone0->translate(_introSarcData1, -_introSarcData1 / 20); if (_moveSarcZones[0]->_left == 35 && _moveSarcZones[1]->_left == 68 && diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h index 956b0e4bb5..12af43e231 100644 --- a/engines/parallaction/zone.h +++ b/engines/parallaction/zone.h @@ -141,6 +141,13 @@ struct Zone : public Node { Command *_commands; Point _moveTo; + void translate(int16 x, int16 y) { + _left += x; + _right += x; + _top += y; + _bottom += y; + } + uint16 width() const { return _right - _left; } |