aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-03-17 21:06:19 +0000
committerNicola Mettifogo2007-03-17 21:06:19 +0000
commite6f64e83dd43384c511ea40c748114f47a301d4d (patch)
tree412eb946f0b3f3c569489c67a58cecb1cc530adf /engines
parent74f7a908866a316ae559012f2229b77e51b6eee0 (diff)
downloadscummvm-rg350-e6f64e83dd43384c511ea40c748114f47a301d4d.tar.gz
scummvm-rg350-e6f64e83dd43384c511ea40c748114f47a301d4d.tar.bz2
scummvm-rg350-e6f64e83dd43384c511ea40c748114f47a301d4d.zip
added translate() to Zone
svn-id: r26185
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/callables.cpp14
-rw-r--r--engines/parallaction/zone.h7
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;
}