diff options
author | Filippos Karapetis | 2014-12-30 15:38:03 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-30 15:38:03 +0200 |
commit | 64979d5e453bd279c88e559d295d47b175a6559b (patch) | |
tree | e7582fda88d0e43e3ecc5e4814fc64dbb1726a87 /engines | |
parent | 88ba96aa3cb76c7d251a60f32d41f415a40b3dc4 (diff) | |
download | scummvm-rg350-64979d5e453bd279c88e559d295d47b175a6559b.tar.gz scummvm-rg350-64979d5e453bd279c88e559d295d47b175a6559b.tar.bz2 scummvm-rg350-64979d5e453bd279c88e559d295d47b175a6559b.zip |
ZVISION: Fix regression in the handling of multiple animations
A regression from 0c4e0673c3. Thanks to Marisa-Chan for noticing
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/scripting/effects/animation_effect.cpp | 10 | ||||
-rw-r--r-- | engines/zvision/scripting/effects/animation_effect.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/engines/zvision/scripting/effects/animation_effect.cpp b/engines/zvision/scripting/effects/animation_effect.cpp index c3cbc25406..511a0db353 100644 --- a/engines/zvision/scripting/effects/animation_effect.cpp +++ b/engines/zvision/scripting/effects/animation_effect.cpp @@ -88,10 +88,13 @@ bool AnimationEffect::process(uint32 deltaTimeInMillis) { if (it != _playList.end()) { playnode *nod = &(*it); - if (!_animation->isPlaying()) { + if (nod->_curFrame == -1) { // The node is just beginning playback + nod->_curFrame = nod->start; + _animation->start(); _animation->seekToFrame(nod->start); + _animation->setEndFrame(nod->stop); nod->_delay = deltaTimeInMillis; // Force the frame to draw if (nod->slot) @@ -111,6 +114,7 @@ bool AnimationEffect::process(uint32 deltaTimeInMillis) { return _disposeAfterUse; } + nod->_curFrame = nod->start; _animation->seekToFrame(nod->start); } @@ -186,9 +190,9 @@ void AnimationEffect::addPlayNode(int32 slot, int x, int y, int x2, int y2, int nod.loop = loops; nod.pos = Common::Rect(x, y, x2 + 1, y2 + 1); nod.start = startFrame; - _animation->setEndFrame(CLIP<int>(endFrame, 0, _animation->getFrameCount() - 1)); - + nod.stop = CLIP<int>(endFrame, 0, _animation->getFrameCount() - 1); nod.slot = slot; + nod._curFrame = -1; nod._delay = 0; nod._scaled = NULL; _playList.push_back(nod); diff --git a/engines/zvision/scripting/effects/animation_effect.h b/engines/zvision/scripting/effects/animation_effect.h index a564b83ff3..fd6e24ab8b 100644 --- a/engines/zvision/scripting/effects/animation_effect.h +++ b/engines/zvision/scripting/effects/animation_effect.h @@ -48,7 +48,9 @@ public: Common::Rect pos; int32 slot; int32 start; + int32 stop; int32 loop; + int32 _curFrame; int32 _delay; Graphics::Surface *_scaled; }; |