[Scummvm-git-logs] scummvm master -> d5ebd9ae9249be09c0afb948394019bb5fc29796

dreammaster dreammaster at scummvm.org
Mon Jul 3 03:30:10 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d5ebd9ae92 TITANIC: Fix switching between forward & backwards movie clips


Commit: d5ebd9ae9249be09c0afb948394019bb5fc29796
    https://github.com/scummvm/scummvm/commit/d5ebd9ae9249be09c0afb948394019bb5fc29796
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-02T21:30:00-04:00

Commit Message:
TITANIC: Fix switching between forward & backwards movie clips

Changed paths:
    engines/titanic/support/avi_surface.cpp


diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 0cf1f8d..1662b3d 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;





More information about the Scummvm-git-logs mailing list