aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-25 08:38:55 +0300
committerEugene Sandulenko2014-04-25 08:38:55 +0300
commit1726f5731d882ad73a0c04ab19746245ee699d1d (patch)
tree5a595ac90b282962ebcb49ff0506f8076ca77a4d
parentc340570138e84277d39c64aaa7fdaf6d8be2cefb (diff)
downloadscummvm-rg350-1726f5731d882ad73a0c04ab19746245ee699d1d.tar.gz
scummvm-rg350-1726f5731d882ad73a0c04ab19746245ee699d1d.tar.bz2
scummvm-rg350-1726f5731d882ad73a0c04ab19746245ee699d1d.zip
FULLPIPE: Further work on MGM::recalcOffsets()
-rw-r--r--engines/fullpipe/motion.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 0dcb0ac2cf..f40c1ae08b 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -2206,25 +2206,21 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
int stidx = getStaticsIndex(idx, item->movements1[i]->_staticsObj2);
int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
- int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
-
- v20 = sz + *(&item->subItems[stidx].field_C + 6 * st2idx * _items[idx].staticsListCount);
-
if (recalc >= 0) {
if (!item->subItems[subIdx].movement || item->subItems[subIdx].field_8 > recalc + 1 ||
(item->subItems[subIdx].field_8 == recalc + 1 && item->subItems[subIdx].field_C > v20) {
item->subItems[subIdx].movement = mov;
item->subItems[subIdx].staticsIndex = stidx;
item->subItems[subIdx].field_8 = recalc + 1;
- item->subItems[subIdx].field_C = v20;
- mov->calcSomeXY(&point, 0);
+ int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
- v25 = point.x + *(&item->subItems[stidx]->x + 6 * st2idx * _items[idx]->staticsListCount);
- v26 = point.y + *(&item->subItems[stidx]->y + 6 * st2idx * _items[idx]->staticsListCount);
+ item->subItems[subIdx].field_C = sz + item->subItems[stidx + 6 * st2idx * _items[idx].staticsListCount]->field_C;
- item->subItems[subIdx]->x = v25;
- item->subItems[subIdx]->y = v26;
+ mov->calcSomeXY(&point, 0);
+
+ item->subItems[subIdx].x = item->subItems[stidx + 6 * st2idx * _items[idx].staticsListCount]->x + point.x;
+ item->subItems[subIdx].y = item->subItems[stidx + 6 * st2idx * _items[idx].staticsListCount]->y + point.y;
}
}
}
@@ -2244,17 +2240,12 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
- item->subItems[subIdx].field_C = sz + *(&item->subItems[stidx].field_C + 6 * st2idx * _items[idx].staticsListCount);
+ item->subItems[subIdx].field_C = sz + item->subItems[stidx + 6 * st2idx * _items[idx].staticsListCount]->field_C;
mov->calcSomeXY(&point, 0);
- v25 = *(&item->subItems[stidx].x + 6 * st2idx * _items[idx].staticsListCount) - point.x;
- v26 = *(&item->subItems[stidx].y + 6 * st2idx * _items[idx].staticsListCount) - point.y;
-
- item->subItems[subIdx].x = v25;
- item->subItems[subIdx].y = v26;
-
- continue;
+ item->subItems[subIdx].x = item->subItems[stidx + 6 * st2idx * _items[idx].staticsListCount]->x - point.x;
+ item->subItems[subIdx].y = item->subItems[stidx + 6 * st2idx * _items[idx].staticsListCount]->y - point.y;
}
}
}