From 4341a366410bc2f15d0001b69261a37d56016b10 Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Sun, 8 Nov 2009 06:46:24 +0000 Subject: 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 --- engines/draci/animation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/draci/animation.cpp') 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) { -- cgit v1.2.3