[Scummvm-git-logs] scummvm master -> 96153644e6b72b7d956d8a45114172a035ce24cc

dreammaster dreammaster at scummvm.org
Sun Oct 30 13:10:46 CET 2016


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

Summary:
6ffa5228c1 TITANIC: Fix setting different video framerates
96153644e6 TITANIC: Cleanup of CServiceElevatorWIndow class


Commit: 6ffa5228c1691e5794600343b083bc922062be5f
    https://github.com/scummvm/scummvm/commit/6ffa5228c1691e5794600343b083bc922062be5f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-10-30T08:10:18-04:00

Commit Message:
TITANIC: Fix setting different video framerates

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 32fa8e4..c3fe545 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -349,9 +349,11 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
 
 void AVISurface::setFrameRate(double rate) {
 	// Convert rate from fps to relative to 1.0 (normal speed)
+	const int PRECISION = 10000;
 	double playRate = rate / 15.0;	// Standard 15 FPS
+	Common::Rational pRate(playRate * PRECISION, PRECISION);
 
-	_decoder->setRate(playRate);
+	_decoder->setRate(pRate);
 }
 
 Graphics::ManagedSurface *AVISurface::getSecondarySurface() {


Commit: 96153644e6b72b7d956d8a45114172a035ce24cc
    https://github.com/scummvm/scummvm/commit/96153644e6b72b7d956d8a45114172a035ce24cc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-10-30T08:10:36-04:00

Commit Message:
TITANIC: Cleanup of CServiceElevatorWIndow class

Changed paths:
    engines/titanic/game/service_elevator_window.cpp
    engines/titanic/game/service_elevator_window.h
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp
index 84f2a8d..d548bbf 100644
--- a/engines/titanic/game/service_elevator_window.cpp
+++ b/engines/titanic/game/service_elevator_window.cpp
@@ -35,25 +35,25 @@ END_MESSAGE_MAP()
 static const int FACTORS[4] = { 0, 20, 100, 0 };
 
 CServiceElevatorWindow::CServiceElevatorWindow() : CBackground(),
-	_fieldE0(0), _notifyFlag(false), _fieldE8(0), _fieldEC(0) {
+	_destFloor(0), _notifyFlag(false), _isIndicator(false), _intoSpace(false) {
 }
 
 void CServiceElevatorWindow::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_destFloor, indent);
 	file->writeNumberLine(_notifyFlag, indent);
-	file->writeNumberLine(_fieldE8, indent);
-	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_isIndicator, indent);
+	file->writeNumberLine(_intoSpace, indent);
 
 	CBackground::save(file, indent);
 }
 
 void CServiceElevatorWindow::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldE0 = file->readNumber();
+	_destFloor = file->readNumber();
 	_notifyFlag = file->readNumber();
-	_fieldE8 = file->readNumber();
-	_fieldEC = file->readNumber();
+	_isIndicator = file->readNumber();
+	_intoSpace = file->readNumber();
 
 	CBackground::load(file);
 }
@@ -61,7 +61,7 @@ void CServiceElevatorWindow::load(SimpleFile *file) {
 bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloorChangeMsg *msg) {
 	if (getView() == findView()) {
 		CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot"));
-		int fps = (_fieldE8 && doorbot) ? 65 : 15;
+		int fps = (_isIndicator && doorbot) ? 65 : 15;
 		CMovieClip *clip = _movieClips.findByName("Going Up");
 
 		if (!clip)
@@ -70,30 +70,33 @@ bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloor
 		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;
+		int startFrame = clip->_startFrame + count * FACTORS[msg->_startFloor] / 100;
+		int endFrame = clip->_startFrame + count * FACTORS[msg->_endFloor] / 100;
 
 		if (_notifyFlag) {
+			// Service elevator indicator
 			playMovie(startFrame, endFrame, MOVIE_NOTIFY_OBJECT);
 		} else {
+			// Background outside elevator
 			playMovie(startFrame, endFrame, 0);
-			if (_fieldEC)
+			if (_intoSpace)
 				playClip("Into Space");
 		}
 	}
 
-	_fieldE0 = msg->_value2;
+	_destFloor = msg->_endFloor;
 	return true;
 }
 
 bool CServiceElevatorWindow::MovieEndMsg(CMovieEndMsg *msg) {
+	// Called when indicator reaches desired destination floor
 	CServiceElevatorMsg elevMsg(5);
 	elevMsg.execute(findRoom()->findByName("Service Elevator Entity"));
 	return true;
 }
 
 bool CServiceElevatorWindow::EnterViewMsg(CEnterViewMsg *msg) {
-	if (_fieldEC) {
+	if (_intoSpace) {
 		playClip("Fade Up");
 		playMovie(1, 2, 0);
 	} else {
@@ -101,7 +104,7 @@ bool CServiceElevatorWindow::EnterViewMsg(CEnterViewMsg *msg) {
 
 		if (clip) {
 			int frameNum = clip->_startFrame + (clip->_endFrame - clip->_startFrame)
-				* FACTORS[_fieldE0] / 100;
+				* FACTORS[_destFloor] / 100;
 			loadFrame(frameNum);
 		} else {
 			loadFrame(0);
diff --git a/engines/titanic/game/service_elevator_window.h b/engines/titanic/game/service_elevator_window.h
index ee94f0c..baeef5a 100644
--- a/engines/titanic/game/service_elevator_window.h
+++ b/engines/titanic/game/service_elevator_window.h
@@ -33,10 +33,10 @@ class CServiceElevatorWindow : public CBackground {
 	bool MovieEndMsg(CMovieEndMsg *msg);
 	bool EnterViewMsg(CEnterViewMsg *msg);
 public:
-	int _fieldE0;
+	int _destFloor;
 	bool _notifyFlag;
-	int _fieldE8;
-	int _fieldEC;
+	bool _isIndicator;
+	bool _intoSpace;
 public:
 	CLASSDEF;
 	CServiceElevatorWindow();
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index b421e8e..4b66159 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -286,7 +286,7 @@ MESSAGE0(CReplaceBowlAndNutsMsg);
 MESSAGE1(CRestaurantMusicChanged, CString, value, "");
 MESSAGE2(CSendCCarryMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CSenseWorkingMsg, CString, value, "Not Working");
-MESSAGE2(CServiceElevatorFloorChangeMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CServiceElevatorFloorChangeMsg, int, startFloor, 0, int, endFloor, 0);
 MESSAGE0(CServiceElevatorFloorRequestMsg);
 MESSAGE1(CServiceElevatorMsg, int, value, 4);
 MESSAGE2(CSetChevButtonImageMsg, int, value1, 0, int, value2, 0);





More information about the Scummvm-git-logs mailing list