diff options
author | Robert Špalek | 2009-11-08 06:16:25 +0000 |
---|---|---|
committer | Robert Špalek | 2009-11-08 06:16:25 +0000 |
commit | 5c8aa6ee91ed9342b991827d0a93bbc32f1bbb38 (patch) | |
tree | a5f2d405f931c8b345184fa8a7698e8c85bc9760 /engines | |
parent | bea00d86cbf6c41e5a93e97fd13f9e2cf1d00361 (diff) | |
download | scummvm-rg350-5c8aa6ee91ed9342b991827d0a93bbc32f1bbb38.tar.gz scummvm-rg350-5c8aa6ee91ed9342b991827d0a93bbc32f1bbb38.tar.bz2 scummvm-rg350-5c8aa6ee91ed9342b991827d0a93bbc32f1bbb38.zip |
Fixed mistake with two inner loop caused by not clearing the path.
Also, optimize play() and stop()
svn-id: r45746
Diffstat (limited to 'engines')
-rw-r--r-- | engines/draci/animation.cpp | 4 | ||||
-rw-r--r-- | engines/draci/walking.cpp | 1 |
2 files changed, 3 insertions, 2 deletions
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; } } |