diff options
author | Paul Gilbert | 2015-01-11 19:30:02 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-11 19:30:02 -0500 |
commit | 1b3473d3431ae8fcac15526f1a59f1dfd0c9fc58 (patch) | |
tree | 7b6d65f429186b8a10edbf1faa4cb043166347c3 /engines/xeen/interface.cpp | |
parent | 892a504009e0d7d6d6304d485bf2fad9519781e9 (diff) | |
download | scummvm-rg350-1b3473d3431ae8fcac15526f1a59f1dfd0c9fc58.tar.gz scummvm-rg350-1b3473d3431ae8fcac15526f1a59f1dfd0c9fc58.tar.bz2 scummvm-rg350-1b3473d3431ae8fcac15526f1a59f1dfd0c9fc58.zip |
XEEN: Implement frame update loop of draw3d
Diffstat (limited to 'engines/xeen/interface.cpp')
-rw-r--r-- | engines/xeen/interface.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 665ce6728d..9e02806750 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -361,7 +361,8 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), _vm(vm) { _intrIndex1 = 0; _flipWtr = false; _flag1 = false; - _flag2 = false; + _animCounter = 0; + _isAnimReset = false; _tillMove = 0; _objNumber = 0; @@ -868,15 +869,30 @@ void Interface::draw3d(bool flag) { moveMonsters(); } - int e3 = 0xE302 + _objNumber * 8; - Direction dir = _vm->_party._mazeDirection; - bool flag2 = _flag2; + MazeObject &objObject = _vm->_map->_mobData._objects[_objNumber]; + Direction partyDirection = _vm->_party._mazeDirection; int objNum = _objNumber - 1; for (uint i = 0; i < _vm->_map->_mobData._objects.size(); ++i) { - if (flag2) { + MazeObject &mazeObject = _vm->_map->_mobData._objects[i]; + AnimationEntry &animEntry = _vm->_map->_animationInfo[mazeObject._spriteId]; + int directionIndex = DIRECTION_ANIM_POSITIONS[mazeObject._direction][partyDirection]; + if (_isAnimReset) { + mazeObject._frame = animEntry._frame1._frames[directionIndex]; + } else { + ++mazeObject._frame; + if (i == objNum && _animCounter > 0 && ( + objObject._spriteId == (_vm->_files->_isDarkCc ? 15 : 16) || + objObject._spriteId == 58 || objObject._spriteId == 73)) { + if (mazeObject._frame > 4 || mazeObject._spriteId == 58) + mazeObject._frame = 1; + } else if (mazeObject._frame == animEntry._frame2._frames[directionIndex]) { + mazeObject._frame = animEntry._frame2._frames[directionIndex]; + } } + + mazeObject._flipped = animEntry._flipped._flags[directionIndex]; } // TODO: more |