aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/scripting/effects/animation_effect.cpp10
-rw-r--r--engines/zvision/scripting/effects/animation_effect.h2
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;
};