Skip to content

Commit

Permalink
TITANIC: Renamings for CBridgeView
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Feb 21, 2017
1 parent 89efab8 commit f189cb1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 11 additions & 11 deletions engines/titanic/game/bridge_view.cpp
Expand Up @@ -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);
}

Expand All @@ -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");
Expand All @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions engines/titanic/game/bridge_view.h
Expand Up @@ -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
Expand Down

0 comments on commit f189cb1

Please sign in to comment.