diff options
author | Robert Špalek | 2009-11-08 06:46:24 +0000 |
---|---|---|
committer | Robert Špalek | 2009-11-08 06:46:24 +0000 |
commit | 4341a366410bc2f15d0001b69261a37d56016b10 (patch) | |
tree | 4c177b8451cb06f2d18f240ecb14180527c2823f /engines/draci/script.cpp | |
parent | a4393d46b203c183d26f931e247f30d760b6ad0b (diff) | |
download | scummvm-rg350-4341a366410bc2f15d0001b69261a37d56016b10.tar.gz scummvm-rg350-4341a366410bc2f15d0001b69261a37d56016b10.tar.bz2 scummvm-rg350-4341a366410bc2f15d0001b69261a37d56016b10.zip |
Implement QuickHero walking.
Pressing Q during the game enables/disables faster walking; all animation
phases are flipped after one refresh instead of after given delay.
svn-id: r45748
Diffstat (limited to 'engines/draci/script.cpp')
-rw-r--r-- | engines/draci/script.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index 340942a7e2..70b6c19f0a 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -365,10 +365,16 @@ void Script::play(Common::Queue<int> ¶ms) { _vm->_game->loop(kInnerUntilExit, true); } -Animation *Script::loadObjectAnimation(GameObject *obj, int animID) { +Animation *Script::loadObjectAnimation(int objID, GameObject *obj, int animID) { _vm->_game->loadAnimation(animID, obj->_z); obj->_anim.push_back(animID); - return _vm->_anims->getAnimation(animID); + Animation *anim = _vm->_anims->getAnimation(animID); + if (objID == kDragonObject && obj->_anim.size() - 1 <= kLastTurning) { + // obj->_anim.size() is the Movement type. All walking and + // turning movements can be accelerated. + anim->supportsQuickAnimation(true); + } + return anim; } void Script::load(Common::Queue<int> ¶ms) { @@ -393,7 +399,7 @@ void Script::load(Common::Queue<int> ¶ms) { // AnimationManager while not being registered in the object's array of // animations. This cannot legally happen and an assertion will be // thrown by loadAnimation(). - loadObjectAnimation(obj, animID); + loadObjectAnimation(objID, obj, animID); } void Script::start(Common::Queue<int> ¶ms) { @@ -426,7 +432,7 @@ void Script::start(Common::Queue<int> ¶ms) { // to apply the hedgehog, but there is no way that the game // player would load the requested animation by itself. // See objekty:5077 and parezy.txt:27. - anim = loadObjectAnimation(obj, animID); + anim = loadObjectAnimation(objID, obj, animID); debugC(1, kDraciBytecodeDebugLevel, "start(%d=%s) cannot find animation %d. Loading.", objID, obj->_title.c_str(), animID); } @@ -456,7 +462,7 @@ void Script::startPlay(Common::Queue<int> ¶ms) { Animation *anim = _vm->_anims->getAnimation(animID); if (!anim) { - anim = loadObjectAnimation(obj, animID); + anim = loadObjectAnimation(objID, obj, animID); debugC(1, kDraciBytecodeDebugLevel, "startPlay(%d=%s) cannot find animation %d. Loading.", objID, obj->_title.c_str(), animID); } |