[Scummvm-git-logs] scummvm master -> 525c9100e83e4eb695ce5db0c163121ef95befce

dreammaster dreammaster at scummvm.org
Sun Oct 30 03:41:47 CET 2016


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:
525c9100e8 TITANIC: Fix playback elevator background at correct speed


Commit: 525c9100e83e4eb695ce5db0c163121ef95befce
    https://github.com/scummvm/scummvm/commit/525c9100e83e4eb695ce5db0c163121ef95befce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-10-29T22:41:37-04:00

Commit Message:
TITANIC: Fix playback elevator background at correct speed

Changed paths:
    engines/titanic/game/service_elevator_window.cpp
    engines/titanic/game/transport/service_elevator.cpp
    engines/titanic/support/avi_surface.cpp



diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp
index 13db7a2..f49f2fa 100644
--- a/engines/titanic/game/service_elevator_window.cpp
+++ b/engines/titanic/game/service_elevator_window.cpp
@@ -61,14 +61,14 @@ void CServiceElevatorWindow::load(SimpleFile *file) {
 bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloorChangeMsg *msg) {
 	if (getView() == findView()) {
 		CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot"));
-		int val = (_fieldE8 && doorbot) ? 65 : 15;
+		int fps = (_fieldE8 && doorbot) ? 65 : 15;
 		CMovieClip *clip = _movieClips.findByName("Going Up");
 
 		if (!clip)
 			return true;
 
-		int count = _endFrame - _startFrame;
-		setMovieFrameRate(1.0 * count / val);
+		int count = clip->_endFrame - clip->_startFrame;
+		setMovieFrameRate(1.0 * count / fps);
 
 		int startFrame = clip->_startFrame + count * FACTORS[msg->_value1] / 100;
 		int endFrame = clip->_startFrame + count * FACTORS[msg->_value2] / 100;
diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp
index f419bcc..9b109f5 100644
--- a/engines/titanic/game/transport/service_elevator.cpp
+++ b/engines/titanic/game/transport/service_elevator.cpp
@@ -116,6 +116,7 @@ bool CServiceElevator::ServiceElevatorMsg(CServiceElevatorMsg *msg) {
 		break;
 
 	case 5:
+		// Reaching destination floor
 		_fieldF8 = false;
 		_fieldDC = _v3;
 		loadSound("z#423.wav");
@@ -164,6 +165,7 @@ bool CServiceElevator::TimerMsg(CTimerMsg *msg) {
 		if (!isSoundActive(_soundHandle1)) {
 			stopAnimTimer(_timerId);
 			if (msg->_actionVal == 0) {
+				// Elevator in motion after pressing button
 				_fieldF8 = true;
 				CServiceElevatorFloorChangeMsg changeMsg(_fieldDC, _v3);
 				changeMsg.execute(getRoom());
@@ -174,6 +176,7 @@ bool CServiceElevator::TimerMsg(CTimerMsg *msg) {
 					actMsg.execute(doorbot);
 				}
 			} else {
+				// Finished playing message for bottom/middle floor disabled
 				enableMouse();
 				if (doorbot) {
 					CActMsg actMsg;
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index c88c89c..32fa8e4 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -348,7 +348,10 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
 }
 
 void AVISurface::setFrameRate(double rate) {
-	_decoder->setRate(Common::Rational((int)rate));
+	// Convert rate from fps to relative to 1.0 (normal speed)
+	double playRate = rate / 15.0;	// Standard 15 FPS
+
+	_decoder->setRate(playRate);
 }
 
 Graphics::ManagedSurface *AVISurface::getSecondarySurface() {





More information about the Scummvm-git-logs mailing list