diff options
author | lukaslw | 2014-05-24 16:35:16 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:14 +0200 |
commit | aded3f0e4504e5db32d1cf92412da19e5a6950bd (patch) | |
tree | 27077683b87de365cec6cb7ef779b35209ff1e4b | |
parent | eff8b0fd91b190a11370bff8e68110723b27489d (diff) | |
download | scummvm-rg350-aded3f0e4504e5db32d1cf92412da19e5a6950bd.tar.gz scummvm-rg350-aded3f0e4504e5db32d1cf92412da19e5a6950bd.tar.bz2 scummvm-rg350-aded3f0e4504e5db32d1cf92412da19e5a6950bd.zip |
PRINCE: Begin of showBackAnims
-rw-r--r-- | engines/prince/prince.cpp | 60 | ||||
-rw-r--r-- | engines/prince/prince.h | 8 | ||||
-rw-r--r-- | engines/prince/script.cpp | 1 |
3 files changed, 64 insertions, 5 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 844944184f..092fa93156 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -253,6 +253,7 @@ bool AnimListItem::loadFromStream(Common::SeekableReadStream &stream) { _flags = stream.readUint16LE(); debug("AnimListItem type %d, fileNumber %d, x %d, y %d, flags %d", _type, _fileNumber, _x, _y, _flags); + debug("startPhase %d, endPhase %d, loopPhase %d", _startPhase, _endPhase, _loopPhase); // 32 byte aligment stream.seek(pos + 32); @@ -704,7 +705,64 @@ void PrinceEngine::showBackAnims() { int tempAnimNr = 0; for (uint i = 0; i < _backAnimList.size(); i++) { if (_backAnimList[i].backAnims[tempAnimNr]._state == 0) { - Graphics::Surface *backAnimSurface = _backAnimList[i].backAnims[tempAnimNr]._animData->getFrame(testAnimFrame); + _backAnimList[i]._seq._counter++; + + if (_backAnimList[i]._seq._type == 2) { + if (_backAnimList[i]._seq._currRelative == 0) { + if (_backAnimList[i]._seq._counter >= _backAnimList[i]._seq._data) { + //change_back_anim + } else { + //not_type_2_1 + } + } else { + //not_type_2_1 + } + } + + //not_type_2_1: + if (_backAnimList[i]._seq._type == 3) { + if (_backAnimList[i]._seq._currRelative == 0) { + if (_backAnimList[i]._seq._counter < _backAnimList[i]._seq._data2) { + //empty_frame - do not show anything + } else { + //movzx eax,w [ebx+size BAS+BASA_Num] + //mov d [ebx.BAS_Current],eax + //call SetBackAnim + //inc d [ebx.BAS_CurrRelative] + } + } else { + //not_type_3_1 + } + } + //not_type_3_1: + + //show_bugger + + debug("frame: %d", _backAnimList[i].backAnims[tempAnimNr]._lastFrame); + if (_backAnimList[i].backAnims[tempAnimNr]._frame == _backAnimList[i].backAnims[tempAnimNr]._lastFrame) { + //loop_back_anim + _backAnimList[i].backAnims[tempAnimNr]._frame = _backAnimList[i].backAnims[tempAnimNr]._loopFrame; + + //change_back_anim + if (_backAnimList[i]._seq._type == 0) { + //show_bugger ?? + _backAnimList[i].backAnims[tempAnimNr]._frame++; //?? + //not_end + } else if (_backAnimList[i]._seq._type == 1) { + //repeat_rnd + } + } else { + _backAnimList[i].backAnims[tempAnimNr]._frame++; + //not_end + } + + //not_end: + _backAnimList[i].backAnims[tempAnimNr]._showFrame = _backAnimList[i].backAnims[tempAnimNr]._frame; + //ShowFrameCode + //ShowFrameCodeShadow + + int frame = _backAnimList[i].backAnims[tempAnimNr]._frame; + Graphics::Surface *backAnimSurface = _backAnimList[i].backAnims[tempAnimNr]._animData->getFrame(frame); _graph->drawTransparent(_backAnimList[i].backAnims[tempAnimNr]._x, _backAnimList[i].backAnims[tempAnimNr]._y, backAnimSurface); // out of range now - crash .exe backAnimSurface->free(); delete backAnimSurface; diff --git a/engines/prince/prince.h b/engines/prince/prince.h index 3f8e3f9c78..efa6033c93 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -76,16 +76,16 @@ struct Text { }; struct AnimListItem { - uint16 _type; + uint16 _type; // type of animation - for background anims RND of frame uint16 _fileNumber; - uint16 _startPhase; + uint16 _startPhase; // first phase number uint16 _endPhase; uint16 _loopPhase; int16 _x; int16 _y; uint16 _loopType; - uint16 _nextAnim; - uint16 _flags; + uint16 _nextAnim; // number of animation to do for loop = 3 + uint16 _flags; // byte 0 - draw overlays, byte 1 - draw in front of overlay, byte 2 - load but turn off drawing bool loadFromStream(Common::SeekableReadStream &stream); }; diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 0c52e6a97e..16439dd604 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -242,6 +242,7 @@ void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList, } newAnim._flags = _vm->_animList[animNumber]._flags; newAnim._lastFrame = _vm->_animList[animNumber]._endPhase; + debug("lastFrame: %d", _vm->_animList[animNumber]._endPhase); newAnim._loopFrame = _vm->_animList[animNumber]._loopPhase; newAnim._loopType = _vm->_animList[animNumber]._loopType; newAnim._nextAnim = _vm->_animList[animNumber]._nextAnim; |