diff options
-rw-r--r-- | engines/titanic/core/game_object.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 9 | ||||
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.cpp | 66 | ||||
-rw-r--r-- | engines/titanic/messages/messages.h | 7 |
5 files changed, 85 insertions, 7 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 1b76ec1960..6f70742d79 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -380,6 +380,14 @@ void CGameObject::playClip(const CString &name, uint flags) { playMovie(clip->_startFrame, clip->_endFrame, flags); } +void CGameObject::playClip(uint startFrame, uint endFrame) { + CMovieClip *clip = new CMovieClip("", startFrame, endFrame); + CGameManager *gameManager = getGameManager(); + CRoomItem *room = gameManager->getRoom(); + + gameManager->playClip(clip, room, room); +} + void CGameObject::playMovie(uint flags) { _frameNumber = -1; if (!_surface && !_resource.empty()) { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 40492676b0..98973b38c3 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -134,7 +134,7 @@ protected: /** * Plays a sound */ - int playSound(const CString &name, int val2, int val3, int val4); + int playSound(const CString &name, int val2 = 100, int val3 = 0, int val4 = 0); /** * Plays a sound @@ -144,7 +144,7 @@ protected: /** * Stop a sound */ - void stopSound(int handle, int val2); + void stopSound(int handle, int val2 = 0); bool soundFn1(int handle); @@ -317,6 +317,11 @@ public: void playClip(const CString &name, uint flags); /** + * Play a clip + */ + void playClip(uint startFrame, uint endFrame); + + /** * Return the current view/node/room as a single string */ CString getViewFullName() const; diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 00a48ea435..4b24f3e37e 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -759,6 +759,7 @@ DEFFN(CBilgeDispensorEvent) DEFFN(CBodyInBilgeRoomMsg) DEFFN(CBowlStateChange) DEFFN(CCarryObjectArrivedMsg) +DEFFN(CChangeMusicMsg) DEFFN(CChangeSeasonMsg) DEFFN(CCheckAllPossibleCodes) DEFFN(CCheckChevCode) @@ -1345,6 +1346,7 @@ void CSaveableObject::initClassList() { ADDFN(CBodyInBilgeRoomMsg, CMessage); ADDFN(CBowlStateChange, CMessage); ADDFN(CCarryObjectArrivedMsg, CMessage); + ADDFN(CChangeMusicMsg, CMessage); ADDFN(CChangeSeasonMsg, CMessage); ADDFN(CCheckAllPossibleCodes, CMessage); ADDFN(CCheckChevCode, CMessage); diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp index f0fab26b61..8879136103 100644 --- a/engines/titanic/game/computer_screen.cpp +++ b/engines/titanic/game/computer_screen.cpp @@ -21,6 +21,7 @@ */ #include "titanic/game/computer_screen.h" +#include "titanic/messages/messages.h" namespace Titanic { @@ -70,8 +71,69 @@ bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) { } bool CComputerScreen::TimerMsg(CTimerMsg *msg) { - // TODO - warning("TODO: CComputerScreen::TimerMsg"); + int handle; + + switch (msg->_val3) { + case 0: + loadSound("a#32.wav"); + loadSound("a#31.wav"); + loadSound("a#33.wav"); + loadSound("a#30.wav"); + loadSound("a#29.wav"); + playSound("a#25.wav"); + addTimer(1, 2000, 0); + break; + + case 1: + playSound("a#32.wav"); + playSound("a#31.wav"); + addTimer(2, 2000, 0); + break; + + case 2: { + CChangeMusicMsg musicMsg(CString(), 1); + musicMsg.execute("HomeMusicPlayer"); + playSound("a#33.wav"); + playSound("a#31.wav"); + changeView("Home.Node 4.E", ""); + playClip(51, 150); + playSound("a#31.wav"); + playClip(151, 200); + + handle = playSound("a#27.wav"); + playClip(200, 306); + playSound("a#30.wav"); + stopSound(handle, 0); + + playClip(306, 338); + handle = playSound("a#28.wav"); + playClip(338, 392); + playSound("a#29.wav"); + stopSound(handle); + + playSound("y#662.wav"); + soundFn3(handle, 10, 2); + playClip(392, 450); + trueTalkFn1("Doorbot", 0x3611A, 0); + sleep(8000); + + playClip(450, 492); + trueTalkFn1("DOorbot", 0x36121, 0); + playClip(492, 522); + soundFn3(handle, 30, 2); + + playClip(523, 540); + soundFn3(handle, 0, 1); + + playClip(541, 551); + stopSound(handle); + break; + } + + default: + break; + } + return true; } diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h index d64972c40d..b3ca1effd9 100644 --- a/engines/titanic/messages/messages.h +++ b/engines/titanic/messages/messages.h @@ -185,13 +185,13 @@ MESSAGE1(CTimeMsg, uint, _ticks, 0); class CTimerMsg : public CTimeMsg { public: uint _timerCtr; - int _fieldC; + int _val3; CString _action; public: CLASSDEF - CTimerMsg() : CTimeMsg(), _timerCtr(0), _fieldC(0) {} + CTimerMsg() : CTimeMsg(), _timerCtr(0), _val3(0) {} CTimerMsg(uint ticks, uint timerCtr, int val2, const CString &action) : - CTimeMsg(ticks), _timerCtr(timerCtr), _fieldC(val2), _action(action) {} + CTimeMsg(ticks), _timerCtr(timerCtr), _val3(val2), _action(action) {} static bool isSupportedBy(const CTreeItem *item) { return supports(item, _type); @@ -207,6 +207,7 @@ MESSAGE0(CArmPickedUpFromTableMsg); MESSAGE0(CBodyInBilgeRoomMsg); MESSAGE1(CBowlStateChange, int, value, 0); MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, "", int, numValue, 0); +MESSAGE2(CChangeMusicMsg, CString, strValue, "", int, numValue, 0); MESSAGE1(CChangeSeasonMsg, CString, season, "Summer"); MESSAGE0(CCheckAllPossibleCodes); MESSAGE2(CCheckChevCode, int, value1, 0, int, value2, 0); |