diff options
Diffstat (limited to 'engines/pink/objects/actions')
-rw-r--r-- | engines/pink/objects/actions/action_loop.cpp | 8 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play.cpp | 2 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play_with_sfx.cpp | 2 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_still.cpp | 8 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_still.h | 2 |
5 files changed, 14 insertions, 8 deletions
diff --git a/engines/pink/objects/actions/action_loop.cpp b/engines/pink/objects/actions/action_loop.cpp index 500a001b4c..ca649b2caf 100644 --- a/engines/pink/objects/actions/action_loop.cpp +++ b/engines/pink/objects/actions/action_loop.cpp @@ -71,12 +71,12 @@ void ActionLoop::update() { decodeNext(); } else { _forward = false; - setFrame(_stopFrame - 1); + ActionCEL::setFrame(_stopFrame - 1); decodeNext(); } } else { if (frame > (int)_startFrame) { - setFrame(frame - 1); + ActionCEL::setFrame(frame - 1); } else { _forward = true; } @@ -85,13 +85,13 @@ void ActionLoop::update() { break; case kRandom: { Common::RandomSource &rnd = _actor->getPage()->getGame()->getRnd(); - setFrame(rnd.getRandomNumberRng(_startFrame, _stopFrame)); + ActionCEL::setFrame(rnd.getRandomNumberRng(_startFrame, _stopFrame)); decodeNext(); break; } case kForward: if (frame == _stopFrame) { - setFrame(_startFrame); + ActionCEL::setFrame(_startFrame); } decodeNext(); break; diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp index e86ff55c21..6d23a8accd 100644 --- a/engines/pink/objects/actions/action_play.cpp +++ b/engines/pink/objects/actions/action_play.cpp @@ -64,7 +64,7 @@ void ActionPlay::onStart() { if (_stopFrame == -1 || _stopFrame >= frameCount) _stopFrame = frameCount - 1; assert(_startFrame < _decoder.getFrameCount()); - setFrame(_startFrame); + ActionCEL::setFrame(_startFrame); // doesn't need to decode startFrame here. Update method will decode } diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp index be3f0cae7c..78c302208d 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.cpp +++ b/engines/pink/objects/actions/action_play_with_sfx.cpp @@ -52,7 +52,7 @@ void ActionPlayWithSfx::toConsole() { void ActionPlayWithSfx::update() { int currFrame = _decoder.getCurFrame(); if (_isLoop && currFrame == _stopFrame) { - setFrame(_startFrame); + ActionCEL::setFrame(_startFrame); decodeNext(); } else ActionPlay::update(); diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp index 5bd645b3cc..9c1ba083c9 100644 --- a/engines/pink/objects/actions/action_still.cpp +++ b/engines/pink/objects/actions/action_still.cpp @@ -52,8 +52,7 @@ void ActionStill::onStart() { if (_startFrame >= _decoder.getFrameCount()) _startFrame = 0; - setFrame(_startFrame); // seek to frame before startFrame - decodeNext(); // decode startFrame + setFrame(_startFrame); _decoder.setEndOfTrack(); assert(!_decoder.needsUpdate()); @@ -61,4 +60,9 @@ void ActionStill::onStart() { _actor->endAction(); } +void ActionStill::setFrame(uint frame) { + ActionCEL::setFrame(frame); + decodeNext(); +} + } // End of namespace Pink diff --git a/engines/pink/objects/actions/action_still.h b/engines/pink/objects/actions/action_still.h index a9b2d5209c..e3fb386c26 100644 --- a/engines/pink/objects/actions/action_still.h +++ b/engines/pink/objects/actions/action_still.h @@ -37,6 +37,8 @@ public: void pause(bool paused) override; + void setFrame(uint frame); + protected: void onStart() override; |