diff options
| author | Eugene Sandulenko | 2013-08-15 00:46:19 +0300 | 
|---|---|---|
| committer | Eugene Sandulenko | 2013-09-06 14:51:14 +0300 | 
| commit | 9f52e9f65068e136680e5fbd4a55eb4ff69720c2 (patch) | |
| tree | 7b3415da15cfa1b468fc97de3738b4e8b9830167 /engines/fullpipe/statics.cpp | |
| parent | 4db2d7e21b6729b04e1760af302a1acdd3bd4ae4 (diff) | |
| download | scummvm-rg350-9f52e9f65068e136680e5fbd4a55eb4ff69720c2.tar.gz scummvm-rg350-9f52e9f65068e136680e5fbd4a55eb4ff69720c2.tar.bz2 scummvm-rg350-9f52e9f65068e136680e5fbd4a55eb4ff69720c2.zip  | |
FULLPIPE: More work on behaviors. Animations start to (buggy) work.
Diffstat (limited to 'engines/fullpipe/statics.cpp')
| -rw-r--r-- | engines/fullpipe/statics.cpp | 43 | 
1 files changed, 42 insertions, 1 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index de5d68983f..168ec90e27 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1225,7 +1225,48 @@ bool Movement::gotoNextFrame(int callback1, int callback2) {  }  bool Movement::gotoPrevFrame() { -	warning("STUB: Movement::gotoPrevFrame()"); +	debug(8, "Movement::gotoPrevFrame()"); + +	if (!_currDynamicPhaseIndex) { +		gotoLastFrame(); +		return false; +	} + +	Common::Point point; + +	getCurrDynamicPhaseXY(point); + +	_ox -= point.x; +	_oy -= point.y; + +	if (_currMovement) { +		if (_currMovement->_framePosOffsets) { +			_ox += _currMovement->getDimensionsOfPhase(&point, _currDynamicPhaseIndex)->x; +			_ox += _currMovement->_framePosOffsets[_currDynamicPhaseIndex]->x; +			_oy -= _currMovement->_framePosOffsets[_currDynamicPhaseIndex]->y; +		} + +		_currDynamicPhaseIndex--; +		if (_currDynamicPhaseIndex < 0) +			_currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1; + +		_ox -= _currMovement->getDimensionsOfPhase(&point, _currDynamicPhaseIndex)->x; +	} else { +		if (_framePosOffsets) { +			_ox -= _framePosOffsets[_currDynamicPhaseIndex]->x; +			_oy -= _framePosOffsets[_currDynamicPhaseIndex]->y; +		} + +		_currDynamicPhaseIndex--; +		if (_currDynamicPhaseIndex < 0) +			_currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1; +	} + +	updateCurrDynamicPhase(); +	getCurrDynamicPhaseXY(point); + +	_ox += point.x; +	_oy += point.y;  	return true;  }  | 
