diff options
Diffstat (limited to 'engines')
22 files changed, 437 insertions, 37 deletions
diff --git a/engines/titanic/carry/maitred_left_arm.cpp b/engines/titanic/carry/maitred_left_arm.cpp index b31c2a6f6d..0962f232bd 100644 --- a/engines/titanic/carry/maitred_left_arm.cpp +++ b/engines/titanic/carry/maitred_left_arm.cpp @@ -21,19 +21,48 @@ */ #include "titanic/carry/maitred_left_arm.h" +#include "titanic/npcs/true_talk_npc.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CMaitreDLeftArm, CArm) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + void CMaitreDLeftArm::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_field174, indent); + file->writeNumberLine(_flag, indent); CArm::save(file, indent); } void CMaitreDLeftArm::load(SimpleFile *file) { file->readNumber(); - _field174 = file->readNumber(); + _flag = file->readNumber(); CArm::load(file); } +bool CMaitreDLeftArm::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (!_flag) { + CTrueTalkNPC *maitreD = dynamic_cast<CTrueTalkNPC *>(findRoomObject("MaitreD")); + startTalking(maitreD, 126); + startTalking(maitreD, 127); + } + + return true; +} + +bool CMaitreDLeftArm::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (checkPoint(msg->_mousePos) && !_flag) { + CVisibleMsg visibleMsg; + visibleMsg.execute("MD left arm background image"); + _flag = true; + + CArmPickedUpFromTableMsg takenMsg; + takenMsg.execute("Restaurant Table Pan Handler", nullptr, MSGFLAG_SCAN); + } + + return CArm::MouseDragStartMsg(msg); +} + } // End of namespace Titanic diff --git a/engines/titanic/carry/maitred_left_arm.h b/engines/titanic/carry/maitred_left_arm.h index 8f5090b073..0e1732df46 100644 --- a/engines/titanic/carry/maitred_left_arm.h +++ b/engines/titanic/carry/maitred_left_arm.h @@ -28,11 +28,14 @@ namespace Titanic { class CMaitreDLeftArm : public CArm { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); private: - int _field174; + bool _flag; public: CLASSDEF; - CMaitreDLeftArm() : CArm(), _field174(0) {} + CMaitreDLeftArm() : CArm(), _flag(false) {} /** * Save the data for the class to file diff --git a/engines/titanic/carry/maitred_right_arm.cpp b/engines/titanic/carry/maitred_right_arm.cpp index 7030e83c9d..5cec6be9bd 100644 --- a/engines/titanic/carry/maitred_right_arm.cpp +++ b/engines/titanic/carry/maitred_right_arm.cpp @@ -24,6 +24,10 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CMaitreDRightArm, CArm) + ON_MESSAGE(DropZoneLostObjectMsg) +END_MESSAGE_MAP() + void CMaitreDRightArm::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CArm::save(file, indent); @@ -34,4 +38,12 @@ void CMaitreDRightArm::load(SimpleFile *file) { CArm::load(file); } +bool CMaitreDRightArm::DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg) { + CActMsg actMsg("LoseArm"); + actMsg.execute("MaitreDBody"); + actMsg.execute("MaitreD Arm Holder"); + _fieldE0 = 1; + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/carry/maitred_right_arm.h b/engines/titanic/carry/maitred_right_arm.h index ce07ed7af4..4a53d45f69 100644 --- a/engines/titanic/carry/maitred_right_arm.h +++ b/engines/titanic/carry/maitred_right_arm.h @@ -28,6 +28,8 @@ namespace Titanic { class CMaitreDRightArm : public CArm { + DECLARE_MESSAGE_MAP; + bool DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg); public: CLASSDEF; diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h index 8c497b6bc2..e07b640c9f 100644 --- a/engines/titanic/core/drop_target.h +++ b/engines/titanic/core/drop_target.h @@ -34,7 +34,7 @@ class CDropTarget : public CGameObject { bool EnterViewMsg(CEnterViewMsg *msg); bool VisibleMsg(CVisibleMsg *msg); bool DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg); -private: +protected: Point _pos1; int _itemFrame; CString _itemMatchName; diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index cafd96e38e..d089ce5ed0 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -349,7 +349,7 @@ protected: /** * Play an arbitrary clip */ - void playClip(const CString &name, uint flags); + void playClip(const CString &name, uint flags = 0); /** * Play a clip @@ -364,7 +364,7 @@ protected: /** * Play a clip randomly from a passed list of names */ - void playRandomClip(const char *const *names, uint flags); + void playRandomClip(const char *const *names, uint flags = 0); /** * Return the current view/node/room as a single string diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp index cb562ec3ca..08a29f2e4b 100644 --- a/engines/titanic/game/long_stick_dispenser.cpp +++ b/engines/titanic/game/long_stick_dispenser.cpp @@ -21,9 +21,21 @@ */ #include "titanic/game/long_stick_dispenser.h" +#include "titanic/core/project_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CLongStickDispenser, CGameObject) + ON_MESSAGE(PuzzleSolvedMsg) + ON_MESSAGE(MovieEndMsg) + ON_MESSAGE(VisibleMsg) + ON_MESSAGE(EnterRoomMsg) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(LeaveViewMsg) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + void CLongStickDispenser::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_fieldBC, indent); @@ -42,10 +54,97 @@ void CLongStickDispenser::load(SimpleFile *file) { CGameObject::load(file); } +bool CLongStickDispenser::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) { + if (!_fieldBC && !_fieldC4 && !_fieldC0) { + CStatusChangeMsg statusMsg; + statusMsg.execute("ShatterGlass"); + _fieldC0 = 1; + loadFrame(19); + } else if (_fieldC0) { + playSound("z#63.wav"); + petDisplayMessage(1, "'This glass is totally and utterly unbreakable."); + } + + return true; +} + +bool CLongStickDispenser::MovieEndMsg(CMovieEndMsg *msg) { + CPuzzleSolvedMsg puzzleMsg; + puzzleMsg.execute("LongStick"); + _fieldC0 = 1; + return true; +} + +bool CLongStickDispenser::VisibleMsg(CVisibleMsg *msg) { + setVisible(msg->_visible); + return true; +} + bool CLongStickDispenser::EnterRoomMsg(CEnterRoomMsg *msg) { _fieldC0 = 0; _fieldC4 = 1; return true; } +bool CLongStickDispenser::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (!_fieldC0) { + playSound("z#62.wav"); + + switch (_fieldBC) { + case 0: + petDisplayMessage(1, "For emergency long stick, smash glass."); + break; + case 1: + petDisplayMessage(1, "This dispenser has suddenly been fitted with unbreakable glass " + "to prevent unseemly hoarding of sticks."); + break; + default: + break; + } + } + + return true; +} + +bool CLongStickDispenser::LeaveViewMsg(CLeaveViewMsg *msg) { + if (_fieldC0 == 1) { + if (_fieldC4) { + playMovie(19, 38, MOVIE_GAMESTATE); + } else { + playMovie(0, 18, MOVIE_GAMESTATE); + _fieldBC = 1; + } + + _fieldC4 = 1; + _fieldC0 = 0; + } + + return true; +} + +bool CLongStickDispenser::EnterViewMsg(CEnterViewMsg *msg) { + setVisible(true); + loadFrame(38); + _cursorId = CURSOR_HAND; + return true; +} + +bool CLongStickDispenser::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) { + return false; + } else if (_fieldC0 == 1 && _fieldC4 == 1) { + CVisibleMsg visibleMsg(true); + visibleMsg.execute("LongStick"); + CPassOnDragStartMsg dragMsg(msg->_mousePos, 1); + dragMsg.execute("LongStick"); + + msg->_dragItem = getRoot()->findByName("LongStick"); + loadFrame(0); + _fieldC4 = 0; + _cursorId = CURSOR_ARROW; + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h index 2a1b86fb84..be05ef9c65 100644 --- a/engines/titanic/game/long_stick_dispenser.h +++ b/engines/titanic/game/long_stick_dispenser.h @@ -29,7 +29,15 @@ namespace Titanic { class CLongStickDispenser : public CGameObject { + DECLARE_MESSAGE_MAP; + bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); + bool VisibleMsg(CVisibleMsg *msg); bool EnterRoomMsg(CEnterRoomMsg *msg); + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool LeaveViewMsg(CLeaveViewMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); private: int _fieldBC; int _fieldC0; diff --git a/engines/titanic/game/maitred/maitred_arm_holder.cpp b/engines/titanic/game/maitred/maitred_arm_holder.cpp index 4d35277a33..75d95640d2 100644 --- a/engines/titanic/game/maitred/maitred_arm_holder.cpp +++ b/engines/titanic/game/maitred/maitred_arm_holder.cpp @@ -24,6 +24,11 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CMaitreDArmHolder, CDropTarget) + ON_MESSAGE(MaitreDArmHolder) + ON_MESSAGE(ActMsg) +END_MESSAGE_MAP() + void CMaitreDArmHolder::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CDropTarget::save(file, indent); @@ -34,4 +39,18 @@ void CMaitreDArmHolder::load(SimpleFile *file) { CDropTarget::load(file); } +bool CMaitreDArmHolder::MaitreDArmHolder(CMaitreDArmHolder *msg) { + _fieldF4 = 0; + return true; +} + +bool CMaitreDArmHolder::ActMsg(CActMsg *msg) { + if (msg->_action == "LoseArm") { + _bounds = Rect(); + setVisible(false); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_arm_holder.h b/engines/titanic/game/maitred/maitred_arm_holder.h index 3392d60e43..22f961f236 100644 --- a/engines/titanic/game/maitred/maitred_arm_holder.h +++ b/engines/titanic/game/maitred/maitred_arm_holder.h @@ -28,6 +28,9 @@ namespace Titanic { class CMaitreDArmHolder : public CDropTarget { + DECLARE_MESSAGE_MAP; + bool MaitreDArmHolder(CMaitreDArmHolder *msg); + bool ActMsg(CActMsg *msg); public: CLASSDEF; diff --git a/engines/titanic/game/maitred/maitred_body.cpp b/engines/titanic/game/maitred/maitred_body.cpp index 6b495e5a1c..4cb12aac8f 100644 --- a/engines/titanic/game/maitred/maitred_body.cpp +++ b/engines/titanic/game/maitred/maitred_body.cpp @@ -20,20 +20,56 @@ * */ -#include "titanic/game/maitred/maitred_legs.h" +#include "titanic/game/maitred/maitred_body.h" namespace Titanic { -void CMaitreDLegs::save(SimpleFile *file, int indent) { +BEGIN_MESSAGE_MAP(CMaitreDBody, CMaitreDProdReceptor) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(AnimateMaitreDMsg) + ON_MESSAGE(ActMsg) +END_MESSAGE_MAP() + +void CMaitreDBody::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldC8, indent); + file->writeNumberLine(_armed, indent); CMaitreDProdReceptor::save(file, indent); } -void CMaitreDLegs::load(SimpleFile *file) { +void CMaitreDBody::load(SimpleFile *file) { file->readNumber(); - _fieldC8 = file->readNumber(); + _armed = file->readNumber(); CMaitreDProdReceptor::load(file); } +bool CMaitreDBody::EnterViewMsg(CEnterViewMsg *msg) { + return true; +} + +bool CMaitreDBody::AnimateMaitreDMsg(CAnimateMaitreDMsg *msg) { + static const char *const ARMED_CLIPS[5] = { + "Talking 1", "Talking 2", "Talking 3", "Talking 4", nullptr + }; + static const char *const UNARMED_CLIPS[5] = { + "Armless Talking 1", "Armless Talking 2", "Armless Talking 3", + "Armless Talking 4", nullptr + }; + + if (!hasActiveMovie()) { + playRandomClip(_armed ? ARMED_CLIPS : UNARMED_CLIPS); + } + + return true; +} + +bool CMaitreDBody::ActMsg(CActMsg *msg) { + if (msg->_action == "LoseArm") { + _armed = false; + loadFrame(262); + playSound("c#75.wav"); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_body.h b/engines/titanic/game/maitred/maitred_body.h index 7016c15c71..1798958e84 100644 --- a/engines/titanic/game/maitred/maitred_body.h +++ b/engines/titanic/game/maitred/maitred_body.h @@ -28,11 +28,15 @@ namespace Titanic { class CMaitreDBody : public CMaitreDProdReceptor { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool AnimateMaitreDMsg(CAnimateMaitreDMsg *msg); + bool ActMsg(CActMsg *msg); private: - int _fieldC8; + bool _armed; public: CLASSDEF; - CMaitreDBody() : CMaitreDProdReceptor(), _fieldC8(1) {} + CMaitreDBody() : CMaitreDProdReceptor(), _armed(true) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/maitred/maitred_legs.cpp b/engines/titanic/game/maitred/maitred_legs.cpp index 5071805101..8c0b0db5ea 100644 --- a/engines/titanic/game/maitred/maitred_legs.cpp +++ b/engines/titanic/game/maitred/maitred_legs.cpp @@ -20,20 +20,76 @@ * */ -#include "titanic/game/maitred/maitred_body.h" +#include "titanic/game/maitred/maitred_legs.h" namespace Titanic { -void CMaitreDBody::save(SimpleFile *file, int indent) { +BEGIN_MESSAGE_MAP(CMaitreDLegs, CMaitreDProdReceptor) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(AnimateMaitreDMsg) +END_MESSAGE_MAP() + +void CMaitreDLegs::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldC8, indent); + file->writeNumberLine(_flag, indent); CMaitreDProdReceptor::save(file, indent); } -void CMaitreDBody::load(SimpleFile *file) { +void CMaitreDLegs::load(SimpleFile *file) { file->readNumber(); - _fieldC8 = file->readNumber(); + _flag = file->readNumber(); CMaitreDProdReceptor::load(file); } +bool CMaitreDLegs::EnterViewMsg(CEnterViewMsg *msg) { + _flag = true; + loadFrame(0); + return true; +} + +bool CMaitreDLegs::AnimateMaitreDMsg(CAnimateMaitreDMsg *msg) { + static const char *const WIGGLE_CLIPS[4] = { + "Hip Wiggle", "Knee Bend", "Wire Wiggle", nullptr + }; + static const char *const FIGHTING_CLIPS[4] = { + "Fighting 1", "Fighting 2", "Leg Fidget", nullptr + }; + static const char *const ARCING_SOUNDS[9] = { + "MaitreD Arcing 1.wav", "MaitreD Arcing 2.wav", + "MaitreD Arcing 3.wav", "MaitreD Arcing 4.wav", + "MaitreD Arcing 5.wav", "MaitreD Arcing 6.wav", + "MaitreD Arcing 7.wav", "MaitreD Arcing 8.wav", + "MaitreD Arcing 9.wav" + }; + + switch (msg->_value) { + case 0: + if (_flag) { + playRandomClip(FIGHTING_CLIPS); + + if (getRandomNumber(2) != 0) + playSound(ARCING_SOUNDS[getRandomNumber(9)], + 40 + getRandomNumber(30)); + } else { + playClip("Walk Right"); + _flag = true; + } + break; + + case 1: + if (_flag) { + playClip("Walk Left"); + _flag = false; + } else { + playRandomClip(WIGGLE_CLIPS); + } + break; + + default: + break; + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_legs.h b/engines/titanic/game/maitred/maitred_legs.h index 24ba01e712..b8a32eef4c 100644 --- a/engines/titanic/game/maitred/maitred_legs.h +++ b/engines/titanic/game/maitred/maitred_legs.h @@ -28,11 +28,14 @@ namespace Titanic { class CMaitreDLegs : public CMaitreDProdReceptor { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool AnimateMaitreDMsg(CAnimateMaitreDMsg *msg); private: - int _fieldC8; + bool _flag; public: CLASSDEF; - CMaitreDLegs() : CMaitreDProdReceptor(), _fieldC8(1) {} + CMaitreDLegs() : CMaitreDProdReceptor(), _flag(true) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.cpp b/engines/titanic/game/maitred/maitred_prod_receptor.cpp index 4823f143b0..66533a542f 100644 --- a/engines/titanic/game/maitred/maitred_prod_receptor.cpp +++ b/engines/titanic/game/maitred/maitred_prod_receptor.cpp @@ -21,13 +21,21 @@ */ #include "titanic/game/maitred/maitred_prod_receptor.h" +#include "titanic/npcs/maitre_d.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CMaitreDProdReceptor, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseMoveMsg) + ON_MESSAGE(ProdMaitreDMsg) + ON_MESSAGE(DisableMaitreDProdReceptor) +END_MESSAGE_MAP() + void CMaitreDProdReceptor::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_fieldBC, indent); - file->writeNumberLine(_fieldC0, indent); + file->writeNumberLine(_counter, indent); file->writeNumberLine(_fieldC4, indent); CGameObject::save(file, indent); @@ -36,10 +44,79 @@ void CMaitreDProdReceptor::save(SimpleFile *file, int indent) { void CMaitreDProdReceptor::load(SimpleFile *file) { file->readNumber(); _fieldBC = file->readNumber(); - _fieldC0 = file->readNumber(); + _counter = file->readNumber(); _fieldC4 = file->readNumber(); CGameObject::load(file); } +bool CMaitreDProdReceptor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (_fieldBC == 2 && static_cast<CGameObject *>(getParent())->hasActiveMovie()) { + return false; + } else { + CProdMaitreDMsg prodMsg(126); + prodMsg.execute(this); + return true; + } +} + +bool CMaitreDProdReceptor::MouseMoveMsg(CMouseMoveMsg *msg) { + if (_fieldBC == 2 && static_cast<CGameObject *>(getParent())->hasActiveMovie()) + return false; + else if (++_counter < 20) + return true; + + _counter = 0; + CProdMaitreDMsg prodMsg(126); + + if (isEquals("Stick")) + prodMsg._value = 121; + else if (isEquals("Hammer")) + prodMsg._value = 122; + else if (isEquals("Lemon")) + prodMsg._value = 123; + else if (isEquals("Chicken")) + prodMsg._value = 124; + else if (isEquals("Perch")) + prodMsg._value = 125; + + CMaitreD *maitreD = static_cast<CMaitreD *>(findRoomObject("MaitreD")); + if (maitreD->_field100 <= 0) + prodMsg.execute(this); + + return true; +} + +bool CMaitreDProdReceptor::ProdMaitreDMsg(CProdMaitreDMsg *msg) { + if (_fieldC4) { + CMaitreD *maitreD = static_cast<CMaitreD *>(findRoomObject("MaitreD")); + if (maitreD->_field100 <= 0) { + CViewItem *view = findView(); + startTalking(maitreD, msg->_value, view); + + switch (_fieldBC) { + case 1: + startTalking(maitreD, 128, view); + break; + case 2: + startTalking(maitreD, 129, view); + break; + case 3: + startTalking(maitreD, 127, view); + break; + default: + startTalking(maitreD, 130, view); + break; + } + } + } + + return true; +} + +bool CMaitreDProdReceptor::DisableMaitreDProdReceptor(CDisableMaitreDProdReceptor *msg) { + _fieldC4 = 0; + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.h b/engines/titanic/game/maitred/maitred_prod_receptor.h index f3a547b8ef..0b00ce0014 100644 --- a/engines/titanic/game/maitred/maitred_prod_receptor.h +++ b/engines/titanic/game/maitred/maitred_prod_receptor.h @@ -28,14 +28,19 @@ namespace Titanic { class CMaitreDProdReceptor : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool MouseMoveMsg(CMouseMoveMsg *msg); + bool ProdMaitreDMsg(CProdMaitreDMsg *msg); + bool DisableMaitreDProdReceptor(CDisableMaitreDProdReceptor *msg); protected: int _fieldBC; - int _fieldC0; + int _counter; int _fieldC4; public: CLASSDEF; CMaitreDProdReceptor() : CGameObject(), - _fieldBC(0), _fieldC0(0), _fieldC4(1) {} + _fieldBC(0), _counter(0), _fieldC4(1) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/missiveomat.cpp b/engines/titanic/game/missiveomat.cpp index 931b146801..32ae24e319 100644 --- a/engines/titanic/game/missiveomat.cpp +++ b/engines/titanic/game/missiveomat.cpp @@ -24,6 +24,14 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CMissiveOMat, CGameObject) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(KeyCharMsg) + ON_MESSAGE(TimerMsg) + ON_MESSAGE(MissiveOMatActionMsg) + ON_MESSAGE(LeaveViewMsg) +END_MESSAGE_MAP() + CMissiveOMat::CMissiveOMat() : CGameObject(), _fieldBC(1), _fieldC0(0), _fieldC4(0), _fieldE0(-1) { } @@ -52,4 +60,33 @@ void CMissiveOMat::load(SimpleFile *file) { CGameObject::load(file); } +bool CMissiveOMat::EnterViewMsg(CEnterViewMsg *msg) { + CMissiveOMatActionMsg actionMsg(9); + actionMsg.execute(this); + return true; +} + +bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) { + // TODO + return true; +} + +bool CMissiveOMat::TimerMsg(CTimerMsg *msg) { + if (_fieldBC == 3) { + // TODO + } + + return true; +} + +bool CMissiveOMat::MissiveOMatActionMsg(CMissiveOMatActionMsg *msg) { + // TODO + return true; +} + +bool CMissiveOMat::LeaveViewMsg(CLeaveViewMsg *msg) { + // TODO + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/missiveomat.h b/engines/titanic/game/missiveomat.h index 7fde8cf25d..c4913deaa0 100644 --- a/engines/titanic/game/missiveomat.h +++ b/engines/titanic/game/missiveomat.h @@ -28,6 +28,12 @@ namespace Titanic { class CMissiveOMat : public CGameObject { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool KeyCharMsg(CKeyCharMsg *msg); + bool TimerMsg(CTimerMsg *msg); + bool MissiveOMatActionMsg(CMissiveOMatActionMsg *msg); + bool LeaveViewMsg(CLeaveViewMsg *msg); public: int _fieldBC; int _fieldC0; diff --git a/engines/titanic/game/transport/lift_indicator.cpp b/engines/titanic/game/transport/lift_indicator.cpp index 1336daf7aa..7471affc36 100644 --- a/engines/titanic/game/transport/lift_indicator.cpp +++ b/engines/titanic/game/transport/lift_indicator.cpp @@ -93,14 +93,14 @@ bool CLiftindicator::EnterViewMsg(CEnterViewMsg *msg) { case 1: case 2: setPosition(Point(_bounds.left, _indicatorPos.y + - multiplier * CLift::_elevator1Floor)); + (int)(multiplier * CLift::_elevator1Floor))); _startFrame = CLift::_elevator1Floor; break; case 3: case 4: setPosition(Point(_bounds.left, _indicatorPos.y + - multiplier * CLift::_elevator3Floor)); + (int)(multiplier * CLift::_elevator3Floor))); _startFrame = CLift::_elevator3Floor; break; @@ -115,14 +115,14 @@ bool CLiftindicator::EnterViewMsg(CEnterViewMsg *msg) { case 1: case 2: setPosition(Point(_bounds.left, _indicatorPos.y + - multiplier * CLift::_elevator2Floor)); + (int)(multiplier * CLift::_elevator2Floor))); _startFrame = CLift::_elevator2Floor; break; case 3: case 4: setPosition(Point(_bounds.left, _indicatorPos.y + - multiplier * CLift::_elevator4Floor)); + (int)(multiplier * CLift::_elevator4Floor))); _startFrame = CLift::_elevator4Floor; break; @@ -158,8 +158,8 @@ bool CLiftindicator::PETActivateMsg(CPETActivateMsg *msg) { && pet->getRoomsFloorNum() != CLift::_elevator4Floor) { petDisplayMessage(1, "This elevator is currently in an advanced state of non-functionality."); } else { - _start = _indicatorPos.y + _startFrame * multiplier; - _end = _indicatorPos.y + _endFrame * multiplier; + _start = _indicatorPos.y + (int)(_startFrame * multiplier); + _end = _indicatorPos.y + (int)(_endFrame * multiplier); lockMouse(); addTimer(100); diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h index 1eade1966d..2eea9bdf3d 100644 --- a/engines/titanic/npcs/true_talk_npc.h +++ b/engines/titanic/npcs/true_talk_npc.h @@ -62,7 +62,6 @@ protected: int _fieldF4; int _fieldF8; int _speechTimerId; - int _field100; int _field104; protected: void processInput(CTextInputMsg *msg, CViewItem *view); @@ -72,6 +71,8 @@ protected: */ void performAction(bool startTalking, CViewItem *view = nullptr); public: + int _field100; +public: CLASSDEF; CTrueTalkNPC(); diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp index 4846329784..ae806feb52 100644 --- a/engines/titanic/sound/sound_manager.cpp +++ b/engines/titanic/sound/sound_manager.cpp @@ -33,14 +33,14 @@ CSoundManager::CSoundManager() : _musicPercent(75.0), _speechPercent(75.0), _masterPercent(75.0), _parrotPercent(75.0), _handleCtr(1) { } -double CSoundManager::getModeVolume(int mode) { +uint CSoundManager::getModeVolume(int mode) { switch (mode) { case -1: - return _masterPercent; + return (uint)_masterPercent; case -2: - return _masterPercent * 30 / 100; + return (uint)(_masterPercent * 30 / 100); case -3: - return _masterPercent * 15 / 100; + return (uint)(_masterPercent * 15 / 100); default: return 0; } diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h index 3dfba92e9c..d1afdb4ad4 100644 --- a/engines/titanic/sound/sound_manager.h +++ b/engines/titanic/sound/sound_manager.h @@ -214,7 +214,7 @@ public: /** * Gets the volume for a given mode? value */ - double getModeVolume(int mode); + uint getModeVolume(int mode); }; class QSoundManagerSound : public ListItem { |