diff options
author | Paul Gilbert | 2017-07-02 21:30:00 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-07-02 21:30:00 -0400 |
commit | d5ebd9ae9249be09c0afb948394019bb5fc29796 (patch) | |
tree | 924cc67552055229af8b6fe09b5e0af49690285d /engines | |
parent | 51f8c458ba715775d39054edd09130ab038ec276 (diff) | |
download | scummvm-rg350-d5ebd9ae9249be09c0afb948394019bb5fc29796.tar.gz scummvm-rg350-d5ebd9ae9249be09c0afb948394019bb5fc29796.tar.bz2 scummvm-rg350-d5ebd9ae9249be09c0afb948394019bb5fc29796.zip |
TITANIC: Fix switching between forward & backwards movie clips
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/support/avi_surface.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index 0cf1f8de66..1662b3d7fd 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -109,6 +109,10 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags if (_movieRangeInfo.size() == 1) { // First play call, so start the movie playing + bool isReversePlayback = _movieRangeInfo.front()->_endFrame < _movieRangeInfo.front()->_startFrame; + + if (isReversed() != isReversePlayback) + setFrameRate(isReversePlayback ? -DEFAULT_FPS : DEFAULT_FPS); return startAtFrame(initialFrame); } else { return true; @@ -199,7 +203,7 @@ bool AVISurface::handleEvents(CMovieEventList &events) { // Not empty, so move onto new first one info = _movieRangeInfo.front(); newFrame = info->_startFrame; - setFrameRate(1.0); + setFrameRate(info->_endFrame < info->_startFrame ? -DEFAULT_FPS : DEFAULT_FPS); } } } @@ -439,10 +443,10 @@ bool AVISurface::addEvent(int *frameNumber, CGameObject *obj) { } void AVISurface::setFrameRate(double rate) { - if (!_decoder->isPlaying()) { - // Store the new frame rate - _frameRate = rate; - } else { + // Store the new frame rate + _frameRate = rate; + + if (_decoder->isPlaying()) { // Convert rate from fps to relative to 1.0 (normal speed) const int PRECISION = 10000; double playRate = rate / DEFAULT_FPS; |