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

dreammaster dreammaster at scummvm.org
Tue Feb 21 05:48:46 CET 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:
f189cb1530 TITANIC: Renamings for CBridgeView


Commit: f189cb15302ad3d0ed6dd24a9cdcbe896d0461c6
    https://github.com/scummvm/scummvm/commit/f189cb15302ad3d0ed6dd24a9cdcbe896d0461c6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-20T23:48:41-05:00

Commit Message:
TITANIC: Renamings for CBridgeView

Changed paths:
    engines/titanic/game/bridge_view.cpp
    engines/titanic/game/bridge_view.h


diff --git a/engines/titanic/game/bridge_view.cpp b/engines/titanic/game/bridge_view.cpp
index f8429f0..e8d70c8 100644
--- a/engines/titanic/game/bridge_view.cpp
+++ b/engines/titanic/game/bridge_view.cpp
@@ -31,13 +31,13 @@ END_MESSAGE_MAP()
 
 void CBridgeView::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_mode, indent);
+	file->writeNumberLine(_action, indent);
 	CBackground::save(file, indent);
 }
 
 void CBridgeView::load(SimpleFile *file) {
 	file->readNumber();
-	_mode = file->readNumber();
+	_action = (BridgeAction)file->readNumber();
 	CBackground::load(file);
 }
 
@@ -47,13 +47,13 @@ bool CBridgeView::ActMsg(CActMsg *msg) {
 	volumeMsg._secondsTransition = 1;
 
 	if (msg->_action == "End") {
-		_mode = 4;
+		_action = BA_ENDING2;
 		petLockInput();
 		petHide();
 		setVisible(true);
 		playMovie(MOVIE_NOTIFY_OBJECT);
 	} else if (msg->_action == "Go") {
-		_mode = 1;
+		_action = BA_GO;
 		setVisible(true);
 		volumeMsg._volume = 100;
 		volumeMsg.execute("EngineSounds");
@@ -65,11 +65,11 @@ bool CBridgeView::ActMsg(CActMsg *msg) {
 		onMsg.execute("EngineSounds");
 
 		if (msg->_action == "Cruise") {
-			_mode = 2;
+			_action = BA_CRUISE;
 			setVisible(true);
 			playMovie(MOVIE_NOTIFY_OBJECT);
 		} else if (msg->_action == "GoEnd") {
-			_mode = 3;
+			_action = BA_ENDING1;
 			setVisible(true);
 			CChangeMusicMsg musicMsg;
 			musicMsg._flags = 1;
@@ -86,21 +86,21 @@ bool CBridgeView::MovieEndMsg(CMovieEndMsg *msg) {
 	CTurnOff offMsg;
 	offMsg.execute("EngineSounds");
 
-	switch (_mode) {
-	case 1:
-	case 2:
+	switch (_action) {
+	case BA_GO:
+	case BA_CRUISE:
 		setVisible(false);
 		decTransitions();
 		break;
 
-	case 3: {
+	case BA_ENDING1: {
 		setVisible(false);
 		CActMsg actMsg("End");
 		actMsg.execute("HomeSequence");
 		break;
 	}
 
-	case 4:
+	case BA_ENDING2:
 		setVisible(false);
 		changeView("TheEnd.Node 3.N");
 		break;
diff --git a/engines/titanic/game/bridge_view.h b/engines/titanic/game/bridge_view.h
index 45cfa3f..01bd631 100644
--- a/engines/titanic/game/bridge_view.h
+++ b/engines/titanic/game/bridge_view.h
@@ -27,15 +27,19 @@
 
 namespace Titanic {
 
+enum BridgeAction {
+	BA_NONE = 0, BA_GO = 1, BA_CRUISE = 2, BA_ENDING1 = 3, BA_ENDING2 = 4
+};
+
 class CBridgeView : public CBackground {
 	DECLARE_MESSAGE_MAP;
 	bool ActMsg(CActMsg *msg);
 	bool MovieEndMsg(CMovieEndMsg *msg);
 public:
-	int _mode;
+	BridgeAction _action;
 public:
 	CLASSDEF;
-	CBridgeView() : CBackground(), _mode(0) {}
+	CBridgeView() : CBackground(), _action(BA_NONE) {}
 
 	/**
 	 * Save the data for the class to file





More information about the Scummvm-git-logs mailing list