aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-17 19:58:59 -0400
committerPaul Gilbert2016-03-17 19:58:59 -0400
commita8d94d448ea977bdd5b1171e177de6dd714792a2 (patch)
treea9756367b569bcbba8f929c036ef943b48e483e0 /engines/titanic/game
parente80a15170640a495b5c7861abeea71d0325684cd (diff)
downloadscummvm-rg350-a8d94d448ea977bdd5b1171e177de6dd714792a2.tar.gz
scummvm-rg350-a8d94d448ea977bdd5b1171e177de6dd714792a2.tar.bz2
scummvm-rg350-a8d94d448ea977bdd5b1171e177de6dd714792a2.zip
TITANIC: Fixes to make message handling const, adding CEnterRoomMsg handlers
Diffstat (limited to 'engines/titanic/game')
-rw-r--r--engines/titanic/game/bar_bell.cpp5
-rw-r--r--engines/titanic/game/bar_bell.h5
-rw-r--r--engines/titanic/game/bomb.cpp15
-rw-r--r--engines/titanic/game/bomb.h9
-rw-r--r--engines/titanic/game/chicken_cooler.cpp5
-rw-r--r--engines/titanic/game/chicken_cooler.h7
-rw-r--r--engines/titanic/game/end_sequence_control.cpp5
-rw-r--r--engines/titanic/game/end_sequence_control.h5
-rw-r--r--engines/titanic/game/fan_noises.cpp5
-rw-r--r--engines/titanic/game/fan_noises.h7
-rw-r--r--engines/titanic/game/get_lift_eye2.cpp5
-rw-r--r--engines/titanic/game/get_lift_eye2.h6
-rw-r--r--engines/titanic/game/gondolier/gondolier_mixer.cpp8
-rw-r--r--engines/titanic/game/gondolier/gondolier_mixer.h5
14 files changed, 77 insertions, 15 deletions
diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
index 71f0e878df..1639b7da39 100644
--- a/engines/titanic/game/bar_bell.cpp
+++ b/engines/titanic/game/bar_bell.cpp
@@ -50,4 +50,9 @@ void CBarBell::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CBarBell::handleEvent(const CEnterRoomMsg &msg) {
+ _fieldBC = 0;
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 279379feaf..432bf3a281 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -24,16 +24,19 @@
#define TITANIC_BAR_BELL_H
#include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CBarBell : public CGameObject {
+class CBarBell : public CGameObject, CEnterRoomMsgTarget {
public:
int _fieldBC;
int _fieldC0;
int _fieldC4;
int _fieldC8;
int _fieldCC;
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
CBarBell();
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index 108376efb3..429f254d66 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -21,6 +21,7 @@
*/
#include "titanic/game/bomb.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -33,7 +34,7 @@ CBomb::CBomb() : CBackground() {
_fieldF4 = 999;
_fieldF8 = 0;
_fieldFC = 0;
- _field100 = 0;
+ _startingTicks = 0;
_field104 = 60;
}
@@ -47,7 +48,7 @@ void CBomb::save(SimpleFile *file, int indent) const {
file->writeNumberLine(_fieldF4, indent);
file->writeNumberLine(_fieldF8, indent);
file->writeNumberLine(_fieldFC, indent);
- file->writeNumberLine(_field100, indent);
+ file->writeNumberLine(_startingTicks, indent);
file->writeNumberLine(_field104, indent);
CBackground::save(file, indent);
@@ -63,10 +64,18 @@ void CBomb::load(SimpleFile *file) {
_fieldF4 = file->readNumber();
_fieldF8 = file->readNumber();
_fieldFC = file->readNumber();
- _field100 = file->readNumber();
+ _startingTicks = file->readNumber();
_field104 = file->readNumber();
CBackground::load(file);
}
+bool CBomb::handleEvent(const CEnterRoomMsg &msg) {
+ _fieldE8 = 12;
+ _fieldEC = 9;
+ _fieldF0 = 0;
+ _startingTicks = g_vm->_ticksCount;
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 2e7ba4658e..4c7c9526ea 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -24,11 +24,12 @@
#define TITANIC_BOMB_H
#include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CBomb : public CBackground {
-public:
+class CBomb : public CBackground, CEnterRoomMsgTarget {
+private:
int _fieldE0;
int _fieldE4;
int _fieldE8;
@@ -37,8 +38,10 @@ public:
int _fieldF4;
int _fieldF8;
int _fieldFC;
- int _field100;
+ int _startingTicks;
int _field104;
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
CBomb();
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index 335ed36fb6..54acc405fd 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -40,4 +40,9 @@ void CChickenCooler::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CChickenCooler::handleEvent(const CEnterRoomMsg &msg) {
+ warning("CChickenCoolor::handlEvent");
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 9e150572f4..6f75649957 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -24,13 +24,16 @@
#define TITANIC_CHICKEN_COOLER_H
#include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CChickenCooler : public CGameObject {
-public:
+class CChickenCooler : public CGameObject, CEnterRoomMsgTarget {
+private:
int _fieldBC;
int _fieldC0;
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index 1432435a28..f930d61787 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -34,4 +34,9 @@ void CEndSequenceControl::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CEndSequenceControl::handleEvent(const CEnterRoomMsg &msg) {
+ warning("TODO: CEndSequenceControl::handleEvent");
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 5e2ba30611..fb1fa3a13c 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -24,10 +24,13 @@
#define TITANIC_END_SEQUENCE_CONTROL_H
#include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CEndSequenceControl : public CGameObject {
+class CEndSequenceControl : public CGameObject, CEnterRoomMsgTarget {
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index ed77dc609f..6627332465 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -55,4 +55,9 @@ void CFanNoises::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CFanNoises::handleEvent(const CEnterRoomMsg &msg) {
+ warning("CFanNoises::handleEvent");
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index ba35edcf76..2cd96a33cb 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -24,11 +24,12 @@
#define TITANIC_FAN_NOISES_H
#include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CFanNoises : public CGameObject {
-public:
+class CFanNoises : public CGameObject, CEnterRoomMsgTarget {
+private:
int _fieldBC;
int _fieldC0;
int _fieldC4;
@@ -36,6 +37,8 @@ public:
int _fieldCC;
int _fieldD0;
int _fieldD4;
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
CFanNoises();
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index 472f884d01..bc51f7cabc 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -46,4 +46,9 @@ void CGetLiftEye2::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CGetLiftEye2::handleEvent(const CEnterRoomMsg &msg) {
+ warning("CGetLiftEye2::handleEvent");
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 6782a56f11..d9465b48bc 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -24,12 +24,14 @@
#define TITANIC_GET_LIFT_EYE2_H
#include "titanic/core/game_object.h"
-
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CGetLiftEye2 : public CGameObject {
+class CGetLiftEye2 : public CGameObject, CEnterRoomMsgTarget {
private:
static CString *_v1;
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
static void init();
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index e81ad34c87..391c513ccc 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -56,4 +56,12 @@ void CGondolierMixer::load(SimpleFile *file) {
CGondolierBase::load(file);
}
+bool CGondolierMixer::handleEvent(const CEnterRoomMsg &msg) {
+ CTreeItem *parent = getParent();
+ if (parent == msg._room)
+ msg.execute(parent);
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 173bcd8ac2..ce8959b77a 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -24,10 +24,11 @@
#define TITANIC_GONDOLIER_MIXER_H
#include "titanic/game/gondolier/gondolier_base.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
-class CGondolierMixer : public CGondolierBase {
+class CGondolierMixer : public CGondolierBase, CEnterRoomMsgTarget {
private:
int _fieldBC;
int _fieldC0;
@@ -36,6 +37,8 @@ private:
CString _string1;
CString _string2;
int _fieldE4;
+protected:
+ virtual bool handleEvent(const CEnterRoomMsg &msg);
public:
CLASSDEF
CGondolierMixer();