diff options
author | whiterandrek | 2018-06-12 11:16:52 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 02524d81c8727ebcb61100df6b88eb25a77bed41 (patch) | |
tree | 38e5edbbf6df7a09feb60424560ceb26b741a30b | |
parent | 5282560ba1d1768625a7b5134de7a1e5df59a8b6 (diff) | |
download | scummvm-rg350-02524d81c8727ebcb61100df6b88eb25a77bed41.tar.gz scummvm-rg350-02524d81c8727ebcb61100df6b88eb25a77bed41.tar.bz2 scummvm-rg350-02524d81c8727ebcb61100df6b88eb25a77bed41.zip |
PINK: remove sprite unnecessary updating by another hack
-rw-r--r-- | engines/pink/cel_decoder.cpp | 5 | ||||
-rw-r--r-- | engines/pink/cel_decoder.h | 3 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play.cpp | 5 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_still.cpp | 2 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_talk.cpp | 3 | ||||
-rw-r--r-- | engines/pink/objects/actions/walk_action.cpp | 4 |
6 files changed, 18 insertions, 4 deletions
diff --git a/engines/pink/cel_decoder.cpp b/engines/pink/cel_decoder.cpp index fc8918e23e..960403733d 100644 --- a/engines/pink/cel_decoder.cpp +++ b/engines/pink/cel_decoder.cpp @@ -80,6 +80,11 @@ void CelDecoder::skipFrame() { track->skipFrame(); } +void CelDecoder::setEndOfTrack() { + CelVideoTrack *track = (CelVideoTrack*) getTrack(0); + track->setEndOfTrack(); +} + CelDecoder::CelVideoTrack::CelVideoTrack(Common::SeekableReadStream *stream, uint16 frameCount, uint16 width, uint16 height, bool skipHeader) : FlicVideoTrack(stream, frameCount, width, height, 1), _center(0,0), _transparentColourIndex(0){ readHeader(); diff --git a/engines/pink/cel_decoder.h b/engines/pink/cel_decoder.h index be67f35c07..1e9cb411a9 100644 --- a/engines/pink/cel_decoder.h +++ b/engines/pink/cel_decoder.h @@ -37,6 +37,8 @@ public: const Graphics::Surface *getCurrentFrame(); void skipFrame(); + void setEndOfTrack(); + protected: class CelVideoTrack : public FlicVideoTrack { public: @@ -48,6 +50,7 @@ protected: uint16 getTransparentColourIndex(); // Hack. Pink needs so that Track needed an update after lastFrame delay ends + void setEndOfTrack() { _curFrame = _frameCount; } bool endOfTrack() const override { return getCurFrame() >= getFrameCount(); } Common::Point getCenter(); diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp index 629e52f27e..bc93eba13c 100644 --- a/engines/pink/objects/actions/action_play.cpp +++ b/engines/pink/objects/actions/action_play.cpp @@ -46,8 +46,11 @@ void ActionPlay::end() { void ActionPlay::update() { ActionCEL::update(); - if (_decoder.getCurFrame() >= _stopFrame) + if (_decoder.getCurFrame() >= _stopFrame) { + _decoder.setEndOfTrack(); + assert(!_decoder.needsUpdate()); _actor->endAction(); + } else decodeNext(); } diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp index 109ec15471..5bd645b3cc 100644 --- a/engines/pink/objects/actions/action_still.cpp +++ b/engines/pink/objects/actions/action_still.cpp @@ -55,7 +55,7 @@ void ActionStill::onStart() { setFrame(_startFrame); // seek to frame before startFrame decodeNext(); // decode startFrame - _decoder.pauseVideo(1); // pause so that decoder doesn't need updates. + _decoder.setEndOfTrack(); assert(!_decoder.needsUpdate()); _actor->endAction(); diff --git a/engines/pink/objects/actions/action_talk.cpp b/engines/pink/objects/actions/action_talk.cpp index 2fe0e0f0d1..2144d8a8de 100644 --- a/engines/pink/objects/actions/action_talk.cpp +++ b/engines/pink/objects/actions/action_talk.cpp @@ -43,7 +43,8 @@ void ActionTalk::toConsole() { void ActionTalk::update() { ActionLoop::update(); if (!_sound.isPlaying()) { - _decoder.pauseVideo(1); + _decoder.setEndOfTrack(); + assert(!_decoder.needsUpdate()); _actor->endAction(); } } diff --git a/engines/pink/objects/actions/walk_action.cpp b/engines/pink/objects/actions/walk_action.cpp index f798f9d036..24b43dbdcc 100644 --- a/engines/pink/objects/actions/walk_action.cpp +++ b/engines/pink/objects/actions/walk_action.cpp @@ -46,8 +46,10 @@ void WalkAction::update() { ActionCEL::update(); if (_decoder.getCurFrame() < (int)_decoder.getFrameCount() - 1) decodeNext(); - else + else { + _decoder.setEndOfTrack(); _actor->endAction(); + } } } // End of namespace Pink |