Fixed mistake with two inner loop caused by not clearing the path.

Also, optimize play() and stop()

svn-id: r45746
This commit is contained in:
Robert Špalek 2009-11-08 06:16:25 +00:00
parent bea00d86cb
commit 5c8aa6ee91
2 changed files with 3 additions and 2 deletions

View File

@ -294,7 +294,7 @@ Animation *AnimationManager::addText(int id, bool playing) {
void AnimationManager::play(int id) { void AnimationManager::play(int id) {
Animation *anim = getAnimation(id); Animation *anim = getAnimation(id);
if (anim) { if (anim && !anim->isPlaying()) {
// Mark the first frame dirty so it gets displayed // Mark the first frame dirty so it gets displayed
anim->markDirtyRect(_vm->_screen->getSurface()); anim->markDirtyRect(_vm->_screen->getSurface());
@ -307,7 +307,7 @@ void AnimationManager::play(int id) {
void AnimationManager::stop(int id) { void AnimationManager::stop(int id) {
Animation *anim = getAnimation(id); Animation *anim = getAnimation(id);
if (anim) { if (anim && anim->isPlaying()) {
// Clean up the last frame that was drawn before stopping // Clean up the last frame that was drawn before stopping
anim->markDirtyRect(_vm->_screen->getSurface()); anim->markDirtyRect(_vm->_screen->getSurface());

View File

@ -650,6 +650,7 @@ bool WalkingState::walkOnNextEdge() {
} else { } else {
// Otherwise we are done. continueWalking() will return false next time. // Otherwise we are done. continueWalking() will return false next time.
debugC(2, kDraciWalkingDebugLevel, "We have walked the whole path"); debugC(2, kDraciWalkingDebugLevel, "We have walked the whole path");
_path.clear();
return false; return false;
} }
} }