aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2014-05-26 15:36:27 +0300
committerEugene Sandulenko2014-05-26 15:36:27 +0300
commitf7269dd7dc8418b014670c71681899db33c8bbcc (patch)
tree81727affae3450a67c828d9d3a0059adc92b1140 /engines
parent403b68e84d673705c179f3cb616bd0c45dab8508 (diff)
downloadscummvm-rg350-f7269dd7dc8418b014670c71681899db33c8bbcc.tar.gz
scummvm-rg350-f7269dd7dc8418b014670c71681899db33c8bbcc.tar.bz2
scummvm-rg350-f7269dd7dc8418b014670c71681899db33c8bbcc.zip
FULLPIPE: More work on MovGraph::method28()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/motion.cpp54
1 files changed, 23 insertions, 31 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 3a7551fe88..ad024ca16f 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -617,44 +617,36 @@ Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y,
_items[idx].movarr._movSteps.clear();
- v15 = ani->_oy;
- point1.x = ani->_ox;
- point1.y = v15;
+ Common::Point point;
+
+ point.x = ani->_ox;
+ point.y = ani->_oy;
- if (!MovGraph_calcChunk(this, idx, ani->_ox, v15, &_items[idx]->movarr, 0))
- MovGraph_findClosestLink(this, idx, &point1, &_items[idx]->movarr);
+ if (!MovGraph_calcChunk(this, idx, ani->_ox, ani->_oy, &_items[idx]->movarr, 0))
+ MovGraph_findClosestLink(this, idx, &point, &_items[idx]->movarr);
_items[idx]->count = 0;
delete _items[idx]->movitems;
_items[idx]->movitems = 0;
- v18 = (int)MovGraph_genMovArr(this, x, y, &arrSize, flag1, 0);
- v26 = v18;
- if (v18) {
- flag1 = 0;
- if (arrSize > 0) {
- v19 = v18;
- x = v18;
- do {
- int sz;
- v20 = MovGraph_calcMovItems(this, _items[idx]->movarr, (MovArr *)v19, &sz);
- Memory = v20;
- if (sz > 0) {
- _items[idx]->movitems = MovGraph_arr16_realloc(_items[idx]->movitems, _items[idx]->count, sz + _items[idx]->count);
- memcpy(_items[idx]->movitems[_items[idx]->count], v20, 16 * sz);
- _items[idx]->count += sz;
- CObjectFree(Memory);
- v19 = x;
- }
- v19 += 32;
- v22 = __OFSUB__(flag1 + 1, arrSize);
- v21 = flag1++ + 1 - arrSize < 0;
- x = v19;
- } while ( v21 ^ v22 );
- v18 = v26;
- }
- CObjectFree((void *)v18);
+ Common::Array<MovArr *> *movarr = genMovArr(x, y, &arrSize, flag1, 0);
+
+ if (movarr) {
+ for (int i = 0; i < arrSize; i++) {
+ int sz;
+ Common::Array<MovItem *> *movitems = calcMovItems(_items[idx]->movarr, movarr[i], &sz);
+
+ if (sz > 0) {
+ _items[idx]->movitems = MovGraph_arr16_realloc(_items[idx]->movitems, _items[idx]->count, sz + _items[idx]->count);
+ memcpy(_items[idx]->movitems[_items[idx]->count], *movitems, 16 * sz);
+ _items[idx]->count += sz;
+
+ delete movitems;
+ }
+ }
+
+ delete movarr;
}
if (_items[idx]->count) {