diff options
author | Robert Špalek | 2009-10-12 00:32:51 +0000 |
---|---|---|
committer | Robert Špalek | 2009-10-12 00:32:51 +0000 |
commit | b99e69f4d9a4ec864d5b6f26787d1841e4bdc56d (patch) | |
tree | 9d82cc5017d54846ff84f2d8867c73c3b88031b7 /engines/draci/script.cpp | |
parent | 3ef5145b41852ce39494e353ee7c95600d49093e (diff) | |
download | scummvm-rg350-b99e69f4d9a4ec864d5b6f26787d1841e4bdc56d.tar.gz scummvm-rg350-b99e69f4d9a4ec864d5b6f26787d1841e4bdc56d.tar.bz2 scummvm-rg350-b99e69f4d9a4ec864d5b6f26787d1841e4bdc56d.zip |
Fix indexing of the dragon's animations.
After inspection, I assert that it isn't true that the _anim array needs to
be sorted. In fact, sorting ruins the ordering of the dragon's animations,
which corresponds to enum Movement.
After fixing this, let the dragon have a rest instead of constantly walking
down.
svn-id: r44962
Diffstat (limited to 'engines/draci/script.cpp')
-rw-r--r-- | engines/draci/script.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index 12976c268b..a090ee6b86 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -338,6 +338,10 @@ int Script::funcActPhase(int objID) const { bool visible = (obj->_location == _vm->_game->getRoomNum() && obj->_visible); if (objID == kDragonObject || visible) { + // FIXME: we should check which animation is active and return + // the phase of it, instead of the first one. this function + // is only used at 3 places of the game, hence possible + // breakage may not show easily. int animID = obj->_anim[0]; Animation *anim = _vm->_anims->getAnimation(animID); ret = anim->currentFrameNum(); @@ -361,23 +365,8 @@ void Script::play(Common::Queue<int> ¶ms) { } Animation *Script::loadObjectAnimation(GameObject *obj, int animID) { - // Load the animation into memory - _vm->_game->loadAnimation(animID, obj->_z); - - // We insert the ID of the loaded animation into the object's internal array - // of owned animation IDs. - // Care must be taken to store them sorted (increasing order) as some things - // depend on this. - - uint i; - for (i = 0; i < obj->_anim.size(); ++i) { - if (obj->_anim[i] > animID) { - break; - } - } - - obj->_anim.insert_at(i, animID); + obj->_anim.push_back(animID); return _vm->_anims->getAnimation(animID); } |