From 5c8aa6ee91ed9342b991827d0a93bbc32f1bbb38 Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Sun, 8 Nov 2009 06:16:25 +0000 Subject: Fixed mistake with two inner loop caused by not clearing the path. Also, optimize play() and stop() svn-id: r45746 --- engines/draci/animation.cpp | 4 ++-- engines/draci/walking.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index 9b7694377f..ea310c1bb6 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -294,7 +294,7 @@ Animation *AnimationManager::addText(int id, bool playing) { void AnimationManager::play(int id) { Animation *anim = getAnimation(id); - if (anim) { + if (anim && !anim->isPlaying()) { // Mark the first frame dirty so it gets displayed anim->markDirtyRect(_vm->_screen->getSurface()); @@ -307,7 +307,7 @@ void AnimationManager::play(int id) { void AnimationManager::stop(int id) { Animation *anim = getAnimation(id); - if (anim) { + if (anim && anim->isPlaying()) { // Clean up the last frame that was drawn before stopping anim->markDirtyRect(_vm->_screen->getSurface()); diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp index a60398029c..f9e29da881 100644 --- a/engines/draci/walking.cpp +++ b/engines/draci/walking.cpp @@ -650,6 +650,7 @@ bool WalkingState::walkOnNextEdge() { } else { // Otherwise we are done. continueWalking() will return false next time. debugC(2, kDraciWalkingDebugLevel, "We have walked the whole path"); + _path.clear(); return false; } } -- cgit v1.2.3