diff options
author | Paul Gilbert | 2016-08-18 13:05:11 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-18 13:05:11 -0400 |
commit | 737a1b8c2f139d43df837e601e5c9ed6ec0f7fde (patch) | |
tree | 8d25ee3e20b165ca4d6d29235e1efc4b88434a62 /engines/titanic/game | |
parent | c62257f720f9d1c8dc6bccfc7b350b932eafa84f (diff) | |
download | scummvm-rg350-737a1b8c2f139d43df837e601e5c9ed6ec0f7fde.tar.gz scummvm-rg350-737a1b8c2f139d43df837e601e5c9ed6ec0f7fde.tar.bz2 scummvm-rg350-737a1b8c2f139d43df837e601e5c9ed6ec0f7fde.zip |
TITANIC: Implemented CBridgeView class
Diffstat (limited to 'engines/titanic/game')
-rw-r--r-- | engines/titanic/game/bridge_view.cpp | 80 | ||||
-rw-r--r-- | engines/titanic/game/bridge_view.h | 7 |
2 files changed, 83 insertions, 4 deletions
diff --git a/engines/titanic/game/bridge_view.cpp b/engines/titanic/game/bridge_view.cpp index 9854969494..466480a64c 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 d7c7c35aa9..45cfa3f4c8 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 |