aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects
diff options
context:
space:
mode:
authorwhiterandrek2018-06-19 10:25:33 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitc4461cb4c347460fafb3725341ca1a2e712c8f1c (patch)
tree407cdd42cb78af321bb9412fce1a6ddd80f03ecb /engines/pink/objects
parent4879f7600ca31bbeae4faab1419fb949b4e2e775 (diff)
downloadscummvm-rg350-c4461cb4c347460fafb3725341ca1a2e712c8f1c.tar.gz
scummvm-rg350-c4461cb4c347460fafb3725341ca1a2e712c8f1c.tar.bz2
scummvm-rg350-c4461cb4c347460fafb3725341ca1a2e712c8f1c.zip
PINK: fix playing of sprites which have incorrect stopFrame
Diffstat (limited to 'engines/pink/objects')
-rw-r--r--engines/pink/objects/actions/action_play.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp
index bc93eba13c..e86ff55c21 100644
--- a/engines/pink/objects/actions/action_play.cpp
+++ b/engines/pink/objects/actions/action_play.cpp
@@ -50,8 +50,7 @@ void ActionPlay::update() {
_decoder.setEndOfTrack();
assert(!_decoder.needsUpdate());
_actor->endAction();
- }
- else
+ } else
decodeNext();
}
@@ -61,8 +60,9 @@ void ActionPlay::pause(bool paused) {
void ActionPlay::onStart() {
debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str());
- if (_stopFrame == -1)
- _stopFrame = _decoder.getFrameCount() - 1;
+ int frameCount = _decoder.getFrameCount();
+ if (_stopFrame == -1 || _stopFrame >= frameCount)
+ _stopFrame = frameCount - 1;
assert(_startFrame < _decoder.getFrameCount());
setFrame(_startFrame);
// doesn't need to decode startFrame here. Update method will decode