[Scummvm-cvs-logs] scummvm master -> 737a1b8c2f139d43df837e601e5c9ed6ec0f7fde

dreammaster dreammaster at scummvm.org
Thu Aug 18 19:05:28 CEST 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:
737a1b8c2f TITANIC: Implemented CBridgeView class


Commit: 737a1b8c2f139d43df837e601e5c9ed6ec0f7fde
    https://github.com/scummvm/scummvm/commit/737a1b8c2f139d43df837e601e5c9ed6ec0f7fde
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-18T13:05:11-04:00

Commit Message:
TITANIC: Implemented CBridgeView class

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 9854969..466480a 100644
--- a/engines/titanic/game/bridge_view.cpp
+++ b/engines/titanic/game/bridge_view.cpp
@@ -24,16 +24,92 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CBridgeView, CBackground)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
 void CBridgeView::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_mode, indent);
 	CBackground::save(file, indent);
 }
 
 void CBridgeView::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldE0 = file->readNumber();
+	_mode = file->readNumber();
 	CBackground::load(file);
 }
 
+bool CBridgeView::ActMsg(CActMsg *msg) {
+	CTurnOn onMsg;
+	CSetVolumeMsg volumeMsg;
+	volumeMsg._secondsTransition = 1;
+
+	if (msg->_action == "End") {
+		_mode = 4;
+		petLockInput();
+		petHide();
+		setVisible(true);
+		playMovie(MOVIE_NOTIFY_OBJECT);
+	} else if (msg->_action == "Go") {
+		_mode = 1;
+		setVisible(true);
+		volumeMsg._volume = 100;
+		volumeMsg.execute("EngineSounds");
+		onMsg.execute("EngineSounds");
+		playMovie(MOVIE_NOTIFY_OBJECT);
+	} else {
+		volumeMsg._volume = 50;
+		volumeMsg.execute("EngineSounds");
+		onMsg.execute("EngineSounds");
+
+		if (msg->_action == "Cruise") {
+			_mode = 2;
+			setVisible(true);
+			playMovie(MOVIE_NOTIFY_OBJECT);
+		} else if (msg->_action == "GoENd") {
+			_mode = 3;
+			setVisible(true);
+			CChangeMusicMsg musicMsg;
+			musicMsg._flags = 1;
+			musicMsg.execute("BridgeAutoMusicPlayer");
+			playSound("a#42.wav");
+			playMovie(MOVIE_NOTIFY_OBJECT);
+		}
+	}
+
+	return true;
+}
+
+bool CBridgeView::MovieEndMsg(CMovieEndMsg *msg) {
+	CTurnOff offMsg;
+	offMsg.execute("EngineSounds");
+
+	switch (_mode) {
+	case 0:
+	case 1:
+		setVisible(false);
+		dec54();
+		break;
+
+	case 2: {
+		setVisible(false);
+		CActMsg actMsg("End");
+		actMsg.execute("HomeSequence");
+		break;
+	}
+
+	case 3:
+		setVisible(false);
+		changeView("TheEnd.Node 3.N");
+		break;
+
+	default:
+		break;
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/bridge_view.h b/engines/titanic/game/bridge_view.h
index d7c7c35..45cfa3f 100644
--- a/engines/titanic/game/bridge_view.h
+++ b/engines/titanic/game/bridge_view.h
@@ -28,11 +28,14 @@
 namespace Titanic {
 
 class CBridgeView : public CBackground {
+	DECLARE_MESSAGE_MAP;
+	bool ActMsg(CActMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
 public:
-	int _fieldE0;
+	int _mode;
 public:
 	CLASSDEF;
-	CBridgeView() : CBackground(), _fieldE0(0) {}
+	CBridgeView() : CBackground(), _mode(0) {}
 
 	/**
 	 * Save the data for the class to file






More information about the Scummvm-git-logs mailing list