FULLPIPE: Implement Shadows::initMovement()

This commit is contained in:
Eugene Sandulenko 2013-09-03 00:21:34 +03:00
parent 1b057ba346
commit eea48b4f12
3 changed files with 40 additions and 1 deletions

View File

@ -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) {

View File

@ -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)

View File

@ -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 *));