mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 01:57:16 +00:00
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
This commit is contained in:
parent
3ef5145b41
commit
b99e69f4d9
@ -958,7 +958,7 @@ void Game::walkHero(int x, int y) {
|
||||
|
||||
// Fetch dragon's animation ID
|
||||
// FIXME: Need to add proper walking (this only warps the dragon to position)
|
||||
int animID = dragon->_anim[0];
|
||||
int animID = dragon->_anim[kStopRight];
|
||||
|
||||
Animation *anim = _vm->_anims->getAnimation(animID);
|
||||
positionAnimAsHero(anim);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user