mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
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:
parent
bea00d86cb
commit
5c8aa6ee91
@ -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());
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user