From cb28fef92cb8894dda95bf2a0f4e9b98de90f89b Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 29 Oct 2016 07:26:35 +0200 Subject: [PATCH] MYST3: Fix the last frame of simple movies not being played Fixes #1310. --- engines/myst3/movie.cpp | 6 ++++-- engines/myst3/movie.h | 3 ++- engines/myst3/myst3.cpp | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp index 791523edc8c..71dbea1e8e1 100644 --- a/engines/myst3/movie.cpp +++ b/engines/myst3/movie.cpp @@ -390,7 +390,7 @@ SimpleMovie::SimpleMovie(Myst3Engine *vm, uint16 id) : _startEngineTick = _vm->_state->getTickCount(); } -bool SimpleMovie::update() { +void SimpleMovie::update() { if (_bink.getCurFrame() < (_startFrame - 1)) { _bink.seekToFrame(_startFrame - 1); } @@ -428,8 +428,10 @@ bool SimpleMovie::update() { drawNextFrameToTexture(); } } +} - return !_bink.endOfVideo() && _bink.getCurFrame() < _endFrame; +bool SimpleMovie::endOfVideo() { + return _bink.endOfVideo() || _bink.getCurFrame() >= _endFrame; } void SimpleMovie::playStartupSound() { diff --git a/engines/myst3/movie.h b/engines/myst3/movie.h index d8489d26ad0..be81af25ea8 100644 --- a/engines/myst3/movie.h +++ b/engines/myst3/movie.h @@ -154,7 +154,8 @@ public: SimpleMovie(Myst3Engine *vm, uint16 id); virtual ~SimpleMovie(); - bool update(); + void update(); + bool endOfVideo(); void playStartupSound(); diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp index 0b5d6fef780..9fa14acdce4 100644 --- a/engines/myst3/myst3.cpp +++ b/engines/myst3/myst3.cpp @@ -1160,7 +1160,9 @@ void Myst3Engine::playSimpleMovie(uint16 id, bool fullframe) { bool skip = false; - while (!skip && !shouldQuit() && movie.update()) { + while (!skip && !shouldQuit() && !movie.endOfVideo()) { + movie.update(); + // Process events Common::Event event; while (getEventManager()->pollEvent(event))