diff options
author | Paul Gilbert | 2016-04-11 20:08:49 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:10:56 -0400 |
commit | 7ac4f7c3aa26831f771418472472735cf73bade9 (patch) | |
tree | 721c918233240d79080585bef0f9862f9e0f8291 /engines/titanic/game | |
parent | 54b055bcf58e8cbcf472ea6838f3ed7ecf377e37 (diff) | |
download | scummvm-rg350-7ac4f7c3aa26831f771418472472735cf73bade9.tar.gz scummvm-rg350-7ac4f7c3aa26831f771418472472735cf73bade9.tar.bz2 scummvm-rg350-7ac4f7c3aa26831f771418472472735cf73bade9.zip |
TITANIC: Implementing CComputerScreen messages
Diffstat (limited to 'engines/titanic/game')
-rw-r--r-- | engines/titanic/game/cdrom.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.cpp | 38 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.h | 5 |
3 files changed, 44 insertions, 0 deletions
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp index 0d89319a86..0fd7eb5dbd 100644 --- a/engines/titanic/game/cdrom.cpp +++ b/engines/titanic/game/cdrom.cpp @@ -65,6 +65,7 @@ bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) { if (newTray->_state && newTray->_insertedCD == "None") { CActMsg actMsg(getName()); actMsg.execute(newTray); + setVisible(false); } } diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp index 04de5e50d8..f0fab26b61 100644 --- a/engines/titanic/game/computer_screen.cpp +++ b/engines/titanic/game/computer_screen.cpp @@ -24,6 +24,13 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CComputerScreen, CGameObject) + ON_MESSAGE(ActMsg) + ON_MESSAGE(MovieEndMsg) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(TimerMsg) +END_MESSAGE_MAP() + CComputerScreen::CComputerScreen() : CGameObject() { } @@ -37,4 +44,35 @@ void CComputerScreen::load(SimpleFile *file) { CGameObject::load(file); } +bool CComputerScreen::ActMsg(CActMsg *msg) { + if (msg->_action == "newCD1" || msg->_action == "newCD2") { + playMovie(27, 53, 16); + playMovie(19, 26, 16); + } else if (msg->_action == "newSTCD") { + playMovie(0, 18, 20); + } + + return true; +} + +bool CComputerScreen::MovieEndMsg(CMovieEndMsg *msg) { + playSound("z#47.wav", 100, 0, 0); + addTimer(0, 3000, 0); + + for (int idx = 0; idx < 10; ++idx) + playMovie(0, 18, 0); + return true; +} + +bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) { + loadFrame(26); + return true; +} + +bool CComputerScreen::TimerMsg(CTimerMsg *msg) { + // TODO + warning("TODO: CComputerScreen::TimerMsg"); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h index aa47482207..fa02ef5e1a 100644 --- a/engines/titanic/game/computer_screen.h +++ b/engines/titanic/game/computer_screen.h @@ -28,6 +28,11 @@ namespace Titanic { class CComputerScreen : public CGameObject { + DECLARE_MESSAGE_MAP + bool ActMsg(CActMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); + bool TimerMsg(CTimerMsg *msg); public: CLASSDEF CComputerScreen(); |