mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
DIRECTOR: Update current frame before running startMovie
The startMovie handler needs "the frame" to return the starting frame, which isn't necessarily 1. Easiest way to fix this is to set up the frame data in the Score::startPlay() handler. Fixes the broken navigation in the Empire State Building in Hell Cab.
This commit is contained in:
parent
ed4d4e355b
commit
a08934a95e
@ -85,7 +85,7 @@ Score::Score(Movie *movie) {
|
||||
_numChannelsDisplayed = 0;
|
||||
_skipTransition = false;
|
||||
|
||||
_curFrameNumber = 0;
|
||||
_curFrameNumber = 1;
|
||||
_framesStream = nullptr;
|
||||
_currentFrame = nullptr;
|
||||
}
|
||||
@ -271,7 +271,6 @@ int Score::getPreviousLabelNumber(int referenceFrame) {
|
||||
}
|
||||
|
||||
void Score::startPlay() {
|
||||
_curFrameNumber = 1;
|
||||
_playState = kPlayStarted;
|
||||
_nextFrameTime = 0;
|
||||
_nextFrameDelay = 0;
|
||||
@ -283,6 +282,9 @@ void Score::startPlay() {
|
||||
return;
|
||||
}
|
||||
|
||||
// load first frame (either 1 or _nextFrame)
|
||||
updateCurrentFrame();
|
||||
|
||||
// All frames in the same movie have the same number of channels
|
||||
if (_playState != kPlayStopped)
|
||||
for (uint i = 0; i < _currentFrame->_sprites.size(); i++)
|
||||
@ -338,6 +340,10 @@ void Score::setDelay(uint32 ticks) {
|
||||
}
|
||||
}
|
||||
|
||||
void Score::setCurrentFrame(uint16 frameId) {
|
||||
_nextFrame = frameId;
|
||||
}
|
||||
|
||||
bool Score::isWaitingForNextFrame() {
|
||||
bool keepWaiting = false;
|
||||
debugC(8, kDebugLoading, "Score::isWaitingForNextFrame(): nextFrameTime: %d, time: %d, sound: %d, click: %d, video: %d", _nextFrameTime, g_system->getMillis(false), _waitForChannel, _waitForClick, _waitForVideoChannel);
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
void stopPlay();
|
||||
void setDelay(uint32 ticks);
|
||||
|
||||
void setCurrentFrame(uint16 frameId) { _nextFrame = frameId; }
|
||||
void setCurrentFrame(uint16 frameId);
|
||||
uint16 getCurrentFrameNum() { return _curFrameNumber; }
|
||||
int getNextFrame() { return _nextFrame; }
|
||||
uint16 getFramesNum() { return _numFrames; }
|
||||
|
Loading…
Reference in New Issue
Block a user