mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-16 01:08:56 +00:00
MYST3: Fix synchronized simple movies
This commit is contained in:
parent
089a089b2a
commit
123a604c1a
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user