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/animation.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/animation.cpp')
-rw-r--r-- | engines/draci/animation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index ea310c1bb6..3121cc2a40 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -38,6 +38,7 @@ Animation::Animation(DraciEngine *vm, int index) : _vm(vm) { _playing = false; _looping = false; _paused = false; + _canBeQuick = false; _tick = _vm->_system->getMillis(); _currentFrame = 0; _hasChangedFrame = true; @@ -95,7 +96,8 @@ void Animation::nextFrame(bool force) { const Drawable *frame = getConstCurrentFrame(); Surface *surface = _vm->_screen->getSurface(); - if (force || (_tick + frame->getDelay() <= _vm->_system->getMillis())) { + if (force || (_tick + frame->getDelay() <= _vm->_system->getMillis()) || + _canBeQuick && _vm->_game->getEnableQuickHero() && _vm->_game->getWantQuickHero()) { // If we are at the last frame and not looping, stop the animation // The animation is also restarted to frame zero if ((_currentFrame == getFrameCount() - 1) && !_looping) { |