mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-19 10:41:55 +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) {
|
_synchronized(false) {
|
||||||
_startFrame = 1;
|
_startFrame = 1;
|
||||||
_endFrame = _bink.getFrameCount();
|
_endFrame = _bink.getFrameCount();
|
||||||
|
_startEngineFrame = _vm->_state->getFrameCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SimpleMovie::update() {
|
bool SimpleMovie::update() {
|
||||||
@ -282,8 +283,6 @@ bool SimpleMovie::update() {
|
|||||||
_bink.seekToFrame(_startFrame - 1);
|
_bink.seekToFrame(_startFrame - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint startEngineFrame = _vm->_state->getFrameCount();
|
|
||||||
|
|
||||||
if (!_synchronized) {
|
if (!_synchronized) {
|
||||||
// Play the movie according to the bink file framerate
|
// Play the movie according to the bink file framerate
|
||||||
if (_bink.needsUpdate()) {
|
if (_bink.needsUpdate()) {
|
||||||
@ -291,7 +290,7 @@ bool SimpleMovie::update() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Draw a movie frame each two engine frames
|
// 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) {
|
if (_bink.getCurFrame() < targetFrame) {
|
||||||
drawNextFrameToTexture();
|
drawNextFrameToTexture();
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,7 @@ public:
|
|||||||
void setSynchronized(bool b) { _synchronized = b; }
|
void setSynchronized(bool b) { _synchronized = b; }
|
||||||
private:
|
private:
|
||||||
bool _synchronized;
|
bool _synchronized;
|
||||||
|
uint _startEngineFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Used by the projectors on J'nanin, see puzzle #14
|
// Used by the projectors on J'nanin, see puzzle #14
|
||||||
|
Loading…
x
Reference in New Issue
Block a user