aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-21 11:25:39 -0400
committerPaul Gilbert2016-08-21 11:25:39 -0400
commit06008ae5caf0e086b0952c73bd5047e9c78cd921 (patch)
treeeaa1ba835cf4c3dc38dd853600835bbc6e421fbf /engines/titanic/game
parentc7ac12272a3b448c9d6118753a62426e42d2a62f (diff)
downloadscummvm-rg350-06008ae5caf0e086b0952c73bd5047e9c78cd921.tar.gz
scummvm-rg350-06008ae5caf0e086b0952c73bd5047e9c78cd921.tar.bz2
scummvm-rg350-06008ae5caf0e086b0952c73bd5047e9c78cd921.zip
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/game')
-rw-r--r--engines/titanic/game/fan.cpp87
-rw-r--r--engines/titanic/game/fan.h8
-rw-r--r--engines/titanic/game/television.h12
-rw-r--r--engines/titanic/game/transport/lift.h2
4 files changed, 98 insertions, 11 deletions
diff --git a/engines/titanic/game/fan.cpp b/engines/titanic/game/fan.cpp
index eabaf63568..3fdebbd3ef 100644
--- a/engines/titanic/game/fan.cpp
+++ b/engines/titanic/game/fan.cpp
@@ -24,9 +24,15 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CFan, CGameObject)
+ ON_MESSAGE(EnterViewMsg)
+ ON_MESSAGE(StatusChangeMsg)
+ ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
void CFan::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_value1, indent);
+ file->writeNumberLine(_state, indent);
file->writeNumberLine(_value2, indent);
CGameObject::save(file, indent);
@@ -34,10 +40,87 @@ void CFan::save(SimpleFile *file, int indent) {
void CFan::load(SimpleFile *file) {
file->readNumber();
- _value1 = file->readNumber();
+ _state = file->readNumber();
_value2 = file->readNumber();
CGameObject::load(file);
}
+bool CFan::EnterViewMsg(CEnterViewMsg *msg) {
+ switch (_state) {
+ case 0:
+ case 1:
+ loadFrame(0);
+ break;
+ case 2:
+ playMovie(24, 34, MOVIE_REPEAT);
+ break;
+ case 3:
+ playMovie(63, 65, MOVIE_REPEAT);
+ break;
+ }
+
+ return true;
+}
+
+bool CFan::StatusChangeMsg(CStatusChangeMsg *msg) {
+ if (msg->_newStatus >= -1 && msg->_newStatus < 3) {
+ int oldState = _state;
+ _state = msg->_newStatus;
+ switch (_state) {
+ case -1:
+ case 0:
+ if (oldState == 0)
+ loadFrame(0);
+ else if (oldState == 1)
+ playMovie(24, 34, MOVIE_STOP_PREVIOUS | MOVIE_NOTIFY_OBJECT);
+ else if (oldState == 2) {
+ playMovie(66, 79, MOVIE_STOP_PREVIOUS);
+ playMovie(24, 34, MOVIE_NOTIFY_OBJECT);
+ }
+ break;
+
+ case 1:
+ if (oldState == 0)
+ playMovie(24, 34, MOVIE_REPEAT | MOVIE_STOP_PREVIOUS);
+ if (oldState == 2)
+ playMovie(66, 79, MOVIE_NOTIFY_OBJECT | MOVIE_STOP_PREVIOUS);
+ break;
+
+ case 2:
+ if (oldState == 1)
+ playMovie(48, 62, MOVIE_NOTIFY_OBJECT | MOVIE_STOP_PREVIOUS);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ msg->execute("PromDeckFanNoises");
+ return true;
+}
+
+bool CFan::MovieEndMsg(CMovieEndMsg *msg) {
+ switch (_state) {
+ case -1:
+ case 0:
+ loadFrame(0);
+ break;
+
+ case 1:
+ playMovie(24, 34, MOVIE_REPEAT);
+ break;
+
+ case 2:
+ playMovie(63, 65, MOVIE_REPEAT);
+ break;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/fan.h b/engines/titanic/game/fan.h
index 2c5a2410a8..9cffce8b68 100644
--- a/engines/titanic/game/fan.h
+++ b/engines/titanic/game/fan.h
@@ -28,11 +28,15 @@
namespace Titanic {
class CFan : public CGameObject {
+ DECLARE_MESSAGE_MAP;
+ bool EnterViewMsg(CEnterViewMsg *msg);
+ bool StatusChangeMsg(CStatusChangeMsg *msg);
+ bool MovieEndMsg(CMovieEndMsg *msg);
public:
- int _value1, _value2;
+ int _state, _value2;
public:
CLASSDEF;
- CFan() : CGameObject(), _value1(0), _value2(0) {}
+ CFan() : CGameObject(), _state(0), _value2(0) {}
/**
* Save the data for the class to file
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 6e6d9b23c2..2e8d469bde 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -45,18 +45,18 @@ class CTelevision : public CBackground {
bool TurnOn(CTurnOn *msg);
bool LightsMsg(CLightsMsg *msg);
private:
+ int _fieldE0;
+ int _fieldE4;
+ bool _isOn;
+ int _fieldEC;
+ int _soundHandle;
+public:
static int _v1;
static bool _turnOn;
static int _v3;
static int _v4;
static int _v5;
static int _v6;
-private:
- int _fieldE0;
- int _fieldE4;
- bool _isOn;
- int _fieldEC;
- int _soundHandle;
public:
CLASSDEF;
CTelevision();
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 4595f0fec2..763e545c31 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -31,7 +31,7 @@ namespace Titanic {
class CLift : public CTransport {
DECLARE_MESSAGE_MAP;
bool EnterRoomMsg(CEnterRoomMsg *msg);
-private:
+public:
static int _v1;
static int _v2;
static int _v3;