MYST3: Fix synchronized simple movies

This commit is contained in:
Bastien Bouclet 2012-01-30 10:56:28 +01:00
parent 089a089b2a
commit 123a604c1a
2 changed files with 3 additions and 3 deletions

View File

@ -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();
}

View File

@ -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