aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/game_object.cpp8
-rw-r--r--engines/titanic/core/game_object.h13
-rw-r--r--engines/titanic/game/cdrom_tray.cpp12
-rw-r--r--engines/titanic/game/computer.cpp16
-rw-r--r--engines/titanic/game/get_lift_eye2.h2
-rw-r--r--engines/titanic/game/television.cpp31
-rw-r--r--engines/titanic/gfx/st_button.cpp2
-rw-r--r--engines/titanic/titanic.h5
8 files changed, 66 insertions, 23 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index cdc2db68df..425c2274d7 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -439,18 +439,20 @@ int CGameObject::getSurface45() const {
return _surface ? _surface->proc45() : 0;
}
-void CGameObject::soundProximity(const CString &name, int val2, int val3, int val4) {
+bool CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
CProximity prox;
prox._field8 = val2;
prox._fieldC = val3;
prox._field20 = val4;
- soundProximity(name, prox);
+ return playSound(name, prox);
}
-void CGameObject::soundProximity(const CString &name, CProximity &prox) {
+bool CGameObject::playSound(const CString &name, CProximity &prox) {
if (prox._field28 == 2) {
// TODO
}
+
+ return false;
}
void CGameObject::gotoView(const CString &viewName, const CString &clipName) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 0ea67a132b..6acaeff00f 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -130,6 +130,16 @@ protected:
void setVisible(bool val);
void petFn2(int val);
void petFn3(CTreeItem *item);
+
+ /**
+ * Plays a sound
+ */
+ bool playSound(const CString &name, int val2, int val3, int val4);
+
+ /**
+ * Plays a sound
+ */
+ bool playSound(const CString &name, CProximity &prox);
public:
int _field60;
CursorId _cursorId;
@@ -192,9 +202,6 @@ public:
* Loads a frame
*/
void loadFrame(int frameNumber);
-
- void soundProximity(const CString &name, int val2, int val3, int val4);
- void soundProximity(const CString &name, CProximity &prox);
};
} // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 77ee539c57..5f576d1263 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -57,7 +57,7 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
if (_state) {
if (_insertedCD == "None") {
fn1(55, 65, 0);
- soundProximity("a#35.wav", 50, 0, 0);
+ playSound("a#35.wav", 50, 0, 0);
_state = 0;
} else {
CTreeItem *treeItem = getRoom()->findByName(_insertedCD);
@@ -71,24 +71,24 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
}
} else if (_insertedCD == "None") {
fn1(44, 54, 0);
- soundProximity("a#34.wav", 50, 0, 0);
+ playSound("a#34.wav", 50, 0, 0);
_state = 1;
} else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") {
fn1(22, 32, 0);
- soundProximity("a#34.wav", 50, 0, 0);
+ playSound("a#34.wav", 50, 0, 0);
_state = 1;
} else if (_insertedCD == "newSTCD") {
fn1(0, 10, 0);
- soundProximity("a#34.wav", 50, 0, 0);
+ playSound("a#34.wav", 50, 0, 0);
_state = 1;
}
} else if (_state) {
if (msg->_action == "newCD1" || msg->_action == "newCD2") {
fn1(33, 43, 4);
- soundProximity("a#35.wav", 50, 0, 0);
+ playSound("a#35.wav", 50, 0, 0);
} else if (msg->_action == "newSTCD") {
fn1(11, 21, 4);
- soundProximity("a#35.wav", 50, 0, 0);
+ playSound("a#35.wav", 50, 0, 0);
} else {
return true;
}
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index 2b0f7767fb..95330f6448 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -46,7 +46,7 @@ void CComputer::load(SimpleFile *file) {
bool CComputer::ActMsg(CActMsg *msg) {
if (_state) {
- soundProximity("a#35.wav", 100, 0, 0);
+ playSound("a#35.wav", 100, 0, 0);
fn1(32, 42, 0);
if (msg->_action == "CD1")
@@ -66,11 +66,11 @@ bool CComputer::ActMsg(CActMsg *msg) {
bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_currentCD == "None") {
if (_state) {
- soundProximity("a#35.wav", 100, 0, 0);
+ playSound("a#35.wav", 100, 0, 0);
fn1(11, 21, 0);
_state = 0;
} else {
- soundProximity("a#34.wav", 100, 0, 0);
+ playSound("a#34.wav", 100, 0, 0);
fn1(0, 10, 0);
_state = 1;
}
@@ -81,7 +81,7 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
actMsg.execute(_currentCD);
_currentCD = "None";
} else {
- soundProximity("a#34.wav", 100, 0, 0);
+ playSound("a#34.wav", 100, 0, 0);
fn1(21, 31, 0);
_state = 1;
}
@@ -92,10 +92,10 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
bool CComputer::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_value2 == 90) {
- soundProximity("a#32.wav", 100, 0, 0);
- soundProximity("a#33.wav", 100, 0, 0);
- soundProximity("a#31.wav", 100, 0, 0);
- soundProximity("a#0.wav", 100, 0, 0);
+ playSound("a#32.wav", 100, 0, 0);
+ playSound("a#33.wav", 100, 0, 0);
+ playSound("a#31.wav", 100, 0, 0);
+ playSound("a#0.wav", 100, 0, 0);
gotoView("Home.Node 4.E", "_TRACK,3,e-cu,4,E");
}
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 16ccf83f2a..d936559313 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CGetLiftEye2 : public CGameObject {
bool EnterRoomMsg(CEnterRoomMsg *msg);
-private:
+public:
static CString *_v1;
public:
CLASSDEF
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 5585cfc429..2ad84d3ff9 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -20,8 +20,10 @@
*
*/
+#include "titanic/titanic.h"
#include "titanic/game/television.h"
#include "titanic/pet_control/pet_control.h"
+#include "titanic/game/get_lift_eye2.h"
namespace Titanic {
@@ -227,7 +229,34 @@ bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
}
bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
- warning("TODO: CMovieEndMsg");
+ if (g_vm->getRandomNumber(6) == 0) {
+ CParrotSpeakMsg parrotMsg("Television", "");
+ parrotMsg.execute("PerchedParrot");
+ }
+
+ if (_fieldE0 == 3 && compareRoomNameTo("SGTState") && !getState8()) {
+ playSound("z#47.wav", 100, 0, 0);
+ _fieldF0 = playSound("b#20.wav", 100, 0, 0);
+ CTreeItem *magazine = getRoot()->findByName("Magazine");
+
+ if (magazine) {
+ warning("TODO: CTelevision::MovieEndMsg");
+ }
+
+ loadFrame(561);
+ } else if (_fieldE0 == 2) {
+ loadFrame(_v1);
+ } else if (_fieldE0 == 4 && _v5) {
+ if (_turnOn)
+ loadFrame(502);
+ else
+ warning("There is currently nothing available for your viewing pleasure on this channel.");
+ } else if (_fieldE0 == 5 && *CGetLiftEye2::_v1 != "NULL") {
+ loadFrame(393 + _v4);
+ } else {
+ warning("There is currently nothing available for your viewing pleasure on this channel.");
+ }
+
return true;
}
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 9a395813af..827fb4a0d4 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -68,7 +68,7 @@ void CSTButton::load(SimpleFile *file) {
bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
changeStatus(0);
- soundProximity(_soundName, 100, 0, 0);
+ playSound(_soundName, 100, 0, 0);
return true;
}
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index e83d7d9bdc..f83e728ca3 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -122,6 +122,11 @@ public:
uint32 getFeatures() const;
bool isDemo() const;
Common::Language getLanguage() const;
+
+ /**
+ * Gets a random number
+ */
+ uint getRandomNumber(uint max) { return _randomSource.getRandomNumber(max); }
};
extern TitanicEngine *g_vm;