diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 6627e35a851..d680d327908 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -1047,7 +1047,29 @@ void Shadows::init() { } void Shadows::initMovement(Movement *mov) { - warning("STUB: Shadows::initMovement()"); + uint num; + + if (mov->_currMovement) + num = mov->_currMovement->_dynamicPhases.size(); + else + num = mov->_dynamicPhases.size(); + + _items.clear(); + _items.resize(num); + + Common::Point point; + + _items[0].dynPhase = (DynamicPhase *)mov->_staticsObj1; + _items[0].dynPhase->getDimensions(&point); + _items[0].width = point.x; + _items[0].height = point.y; + + for (uint i = 1; i < num; i++) { + _items[i].dynPhase = mov->getDynamicPhaseByIndex(i); + _items[i].dynPhase->getDimensions(&point); + _items[i].width = point.x; + _items[i].height = point.y; + } } DynamicPhase *Shadows::findSize(int width, int height) { diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index c4ceaf2439c..46d48d5d29d 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1348,6 +1348,22 @@ void Movement::setDynamicPhaseIndex(int index) { gotoPrevFrame(); } +DynamicPhase *Movement::getDynamicPhaseByIndex(int idx) { + debug(7, "Movement::updateCurrDynamicPhase()"); + + if (_currMovement) { + if (_currMovement->_dynamicPhases.size() == 0 || (uint)idx >= _currMovement->_dynamicPhases.size()) + return 0; + + return (DynamicPhase *)_currMovement->_dynamicPhases[idx]; + } else { + if (_dynamicPhases.size() == 0 || (uint)idx >= _dynamicPhases.size()) + return 0; + + return (DynamicPhase *)_dynamicPhases[idx]; + } +} + void Movement::loadPixelData() { Movement *mov = this; for (Movement *i = _currMovement; i; i = i->_currMovement) diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 5ae4a1c2d5d..295da9b676e 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -143,6 +143,7 @@ class Movement : public GameObject { void setAlpha(int alpha); void setDynamicPhaseIndex(int index); + DynamicPhase *getDynamicPhaseByIndex(int idx); void removeFirstPhase(); bool gotoNextFrame(int callback1, void (*callback2)(int *));