Skip to content

Commit

Permalink
PINK: fix playing of sprites which have incorrect stopFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent 4879f76 commit c4461cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions engines/pink/objects/actions/action_play.cpp
Expand Up @@ -50,8 +50,7 @@ void ActionPlay::update() {
_decoder.setEndOfTrack();
assert(!_decoder.needsUpdate());
_actor->endAction();
}
else
} else
decodeNext();
}

Expand All @@ -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
Expand Down

0 comments on commit c4461cb

Please sign in to comment.