From 123a604c1a6f254e4eadc6d0f1e468877118cccc Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Mon, 30 Jan 2012 10:56:28 +0100 Subject: [PATCH] MYST3: Fix synchronized simple movies --- engines/myst3/movie.cpp | 5 ++--- engines/myst3/movie.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp index dbd8c13ba3a..f28a3956ba7 100644 --- a/engines/myst3/movie.cpp +++ b/engines/myst3/movie.cpp @@ -275,6 +275,7 @@ SimpleMovie::SimpleMovie(Myst3Engine *vm, uint16 id) : _synchronized(false) { _startFrame = 1; _endFrame = _bink.getFrameCount(); + _startEngineFrame = _vm->_state->getFrameCount(); } bool SimpleMovie::update() { @@ -282,8 +283,6 @@ bool SimpleMovie::update() { _bink.seekToFrame(_startFrame - 1); } - uint startEngineFrame = _vm->_state->getFrameCount(); - if (!_synchronized) { // Play the movie according to the bink file framerate if (_bink.needsUpdate()) { @@ -291,7 +290,7 @@ bool SimpleMovie::update() { } } else { // Draw a movie frame each two engine frames - int targetFrame = (_vm->_state->getFrameCount() - startEngineFrame) >> 2; + int targetFrame = (_vm->_state->getFrameCount() - _startEngineFrame) >> 2; if (_bink.getCurFrame() < targetFrame) { drawNextFrameToTexture(); } diff --git a/engines/myst3/movie.h b/engines/myst3/movie.h index d2babce236c..317b119d6bb 100644 --- a/engines/myst3/movie.h +++ b/engines/myst3/movie.h @@ -130,6 +130,7 @@ public: void setSynchronized(bool b) { _synchronized = b; } private: bool _synchronized; + uint _startEngineFrame; }; // Used by the projectors on J'nanin, see puzzle #14