diff options
Diffstat (limited to 'engines/titanic/messages')
-rw-r--r-- | engines/titanic/messages/auto_sound_event.cpp | 46 | ||||
-rw-r--r-- | engines/titanic/messages/auto_sound_event.h | 51 | ||||
-rw-r--r-- | engines/titanic/messages/bilge_auto_sound_event.cpp | 37 | ||||
-rw-r--r-- | engines/titanic/messages/bilge_auto_sound_event.h | 47 | ||||
-rw-r--r-- | engines/titanic/messages/bilge_dispensor_event.cpp | 42 | ||||
-rw-r--r-- | engines/titanic/messages/bilge_dispensor_event.h | 50 | ||||
-rw-r--r-- | engines/titanic/messages/door_auto_sound_event.cpp | 47 | ||||
-rw-r--r-- | engines/titanic/messages/door_auto_sound_event.h | 55 | ||||
-rw-r--r-- | engines/titanic/messages/messages.cpp | 126 | ||||
-rw-r--r-- | engines/titanic/messages/messages.h | 420 | ||||
-rw-r--r-- | engines/titanic/messages/mouse_messages.h | 198 | ||||
-rw-r--r-- | engines/titanic/messages/pet_messages.h | 47 | ||||
-rw-r--r-- | engines/titanic/messages/service_elevator_door.cpp | 48 | ||||
-rw-r--r-- | engines/titanic/messages/service_elevator_door.h | 48 |
14 files changed, 1262 insertions, 0 deletions
diff --git a/engines/titanic/messages/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp new file mode 100644 index 0000000000..006762c49b --- /dev/null +++ b/engines/titanic/messages/auto_sound_event.cpp @@ -0,0 +1,46 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/messages/auto_sound_event.h" + +namespace Titanic { + +CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _value1(0), _value2(70) { +} + +void CAutoSoundEvent::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_value1, indent); + file->writeNumberLine(_value2, indent); + + CGameObject::save(file, indent); +} + +void CAutoSoundEvent::load(SimpleFile *file) { + file->readNumber(); + _value1 = file->readNumber(); + _value2 = file->readNumber(); + + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h new file mode 100644 index 0000000000..03baba354f --- /dev/null +++ b/engines/titanic/messages/auto_sound_event.h @@ -0,0 +1,51 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_AUTO_SOUND_EVENT_H +#define TITANIC_AUTO_SOUND_EVENT_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CAutoSoundEvent : public CGameObject { +public: + int _value1; + int _value2; +public: + CLASSDEF + CAutoSoundEvent(); + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_AUTO_SOUND_EVENT_H */ diff --git a/engines/titanic/messages/bilge_auto_sound_event.cpp b/engines/titanic/messages/bilge_auto_sound_event.cpp new file mode 100644 index 0000000000..7bc91da0bc --- /dev/null +++ b/engines/titanic/messages/bilge_auto_sound_event.cpp @@ -0,0 +1,37 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/messages/bilge_auto_sound_event.h" + +namespace Titanic { + +void CBilgeAutoSoundEvent::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + CAutoSoundEvent::save(file, indent); +} + +void CBilgeAutoSoundEvent::load(SimpleFile *file) { + file->readNumber(); + CAutoSoundEvent::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/bilge_auto_sound_event.h b/engines/titanic/messages/bilge_auto_sound_event.h new file mode 100644 index 0000000000..e51f74bfa5 --- /dev/null +++ b/engines/titanic/messages/bilge_auto_sound_event.h @@ -0,0 +1,47 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_BILGE_AUTO_SOUND_EVENT_H +#define TITANIC_BILGE_AUTO_SOUND_EVENT_H + +#include "titanic/messages/auto_sound_event.h" + +namespace Titanic { + +class CBilgeAutoSoundEvent : public CAutoSoundEvent { +public: + CLASSDEF + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_BILGE_AUTO_SOUND_EVENT_H */ diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp new file mode 100644 index 0000000000..c20fe10992 --- /dev/null +++ b/engines/titanic/messages/bilge_dispensor_event.cpp @@ -0,0 +1,42 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/messages/bilge_dispensor_event.h" + +namespace Titanic { + +void CBilgeDispensorEvent::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + CAutoSoundEvent::save(file, indent); +} + +void CBilgeDispensorEvent::load(SimpleFile *file) { + file->readNumber(); + CAutoSoundEvent::load(file); +} + +bool CBilgeDispensorEvent::handleEvent(CEnterRoomMsg &msg) { + _value1 = 0; + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h new file mode 100644 index 0000000000..9f91b61ef9 --- /dev/null +++ b/engines/titanic/messages/bilge_dispensor_event.h @@ -0,0 +1,50 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_BILGE_DISPENSOR_EVENT_H +#define TITANIC_BILGE_DISPENSOR_EVENT_H + +#include "titanic/messages/auto_sound_event.h" +#include "titanic/messages/messages.h" + +namespace Titanic { + +class CBilgeDispensorEvent : public CAutoSoundEvent { +protected: + virtual bool handleEvent(CEnterRoomMsg &msg); +public: + CLASSDEF + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_BILGE_DISPENSOR_EVENT_H */ diff --git a/engines/titanic/messages/door_auto_sound_event.cpp b/engines/titanic/messages/door_auto_sound_event.cpp new file mode 100644 index 0000000000..ff9101f506 --- /dev/null +++ b/engines/titanic/messages/door_auto_sound_event.cpp @@ -0,0 +1,47 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/messages/door_auto_sound_event.h" + +namespace Titanic { + +void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeQuotedLine(_string1, indent); + file->writeQuotedLine(_string2, indent); + file->writeNumberLine(_fieldDC, indent); + file->writeNumberLine(_fieldE0, indent); + + CAutoSoundEvent::save(file, indent); +} + +void CDoorAutoSoundEvent::load(SimpleFile *file) { + file->readNumber(); + _string1 = file->readString(); + _string2 = file->readString(); + _fieldDC = file->readNumber(); + _fieldE0 = file->readNumber(); + + CAutoSoundEvent::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h new file mode 100644 index 0000000000..cccc3fff9d --- /dev/null +++ b/engines/titanic/messages/door_auto_sound_event.h @@ -0,0 +1,55 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H +#define TITANIC_DOOR_AUTO_SOUND_EVENT_H + +#include "titanic/messages/auto_sound_event.h" + +namespace Titanic { + +class CDoorAutoSoundEvent : public CAutoSoundEvent { +public: + CString _string1; + CString _string2; + int _fieldDC; + int _fieldE0; +public: + CLASSDEF + CDoorAutoSoundEvent() : CAutoSoundEvent(), + _string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) { + } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */ diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp new file mode 100644 index 0000000000..b44748d899 --- /dev/null +++ b/engines/titanic/messages/messages.cpp @@ -0,0 +1,126 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/messages/messages.h" +#include "titanic/messages/mouse_messages.h" +#include "titanic/core/game_object.h" +#include "titanic/core/tree_item.h" + +namespace Titanic { + +CMessage::CMessage() : CSaveableObject() { +} + +void CMessage::save(SimpleFile *file, int indent) const { + file->writeNumberLine(0, indent); +} + +void CMessage::load(SimpleFile *file) { + file->readNumber(); + CSaveableObject::load(file); +} + +bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) const { + // If no target was specified, then there's nothing to do + if (!target) + return false; + + bool result = false; + CTreeItem *item = target; + CTreeItem *nextItem = nullptr; + do { + if (flags & MSGFLAG_SCAN) + nextItem = item->scan(target); + + if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(classDef)) { + bool handled = perform(item); + + if (handled) { + result = true; + if (flags & MSGFLAG_BREAK_IF_HANDLED) + return true; + } + } + + item = nextItem; + } while (nextItem); + + return result; +} + +bool CMessage::isMouseMsg() const { + return dynamic_cast<const CMouseMsg *>(this) != nullptr; +} + +bool CMessage::isButtonDownMsg() const { + return dynamic_cast<const CMouseButtonDownMsg *>(this) != nullptr; +} + +bool CMessage::isButtonUpMsg() const { + return dynamic_cast<const CMouseButtonUpMsg *>(this) != nullptr; +} + +bool CMessage::isMouseMoveMsg() const { + return dynamic_cast<const CMouseMoveMsg *>(this) != nullptr; +} + +bool CMessage::isDoubleClickMsg() const { + return dynamic_cast<const CMouseButtonDoubleClickMsg *>(this) != nullptr; +} + +bool CMessage::isEnterRoomMsg() const { + return dynamic_cast<const CEnterRoomMsg *>(this) != nullptr; +} + +bool CMessage::isPreEnterRoomMsg() const { + return dynamic_cast<const CPreEnterRoomMsg *>(this) != nullptr; +} + +bool CMessage::isleaveRoomMsg() const { + return dynamic_cast<const CLeaveRoomMsg *>(this) != nullptr; +} + +bool CMessage::isEnterNodeMsg() const { + return dynamic_cast<const CEnterNodeMsg *>(this) != nullptr; +} + +bool CMessage::isPreEnterNodeMsg() const { + return dynamic_cast<const CPreEnterNodeMsg *>(this) != nullptr; +} + +bool CMessage::isLeaveNodeMsg() const { + return dynamic_cast<const CLeaveNodeMsg *>(this) != nullptr; +} + +bool CMessage::isEnterViewMsg() const { + return dynamic_cast<const CEnterViewMsg *>(this) != nullptr; +} + +bool CMessage::isPreEnterViewMsg() const { + return dynamic_cast<const CPreEnterViewMsg *>(this) != nullptr; +} + +bool CMessage::isLeaveViewMsg() const { + return dynamic_cast<const CLeaveViewMsg *>(this) != nullptr; +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h new file mode 100644 index 0000000000..ccea453a26 --- /dev/null +++ b/engines/titanic/messages/messages.h @@ -0,0 +1,420 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_MESSAGES_H +#define TITANIC_MESSAGES_H + +#include "titanic/core/saveable_object.h" +#include "titanic/core/tree_item.h" + +namespace Titanic { + +enum MessageFlag { + MSGFLAG_SCAN = 1, + MSGFLAG_BREAK_IF_HANDLED = 2, + MSGFLAG_CLASS_DEF = 4 +}; + +#define MSGTARGET(NAME) class NAME; class NAME##Target { public: \ + virtual bool handleEvent(NAME &msg) = 0; } + +class CGameObject; +class CRoomItem; +class CNodeItem; +class CViewItem; + +class CMessage : public CSaveableObject { +public: + CLASSDEF + CMessage(); + + bool execute(CTreeItem *target, const ClassDef *classDef = nullptr, + int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED) const; + + virtual bool perform(CTreeItem *treeItem) const { return false; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); + + virtual bool isMouseMsg() const; + virtual bool isButtonDownMsg() const; + virtual bool isButtonUpMsg() const; + virtual bool isMouseMoveMsg() const; + virtual bool isDoubleClickMsg() const; + virtual bool isEnterRoomMsg() const; + virtual bool isPreEnterRoomMsg() const; + virtual bool isleaveRoomMsg() const; + virtual bool isEnterNodeMsg() const; + virtual bool isPreEnterNodeMsg() const; + virtual bool isLeaveNodeMsg() const; + virtual bool isEnterViewMsg() const; + virtual bool isPreEnterViewMsg() const; + virtual bool isLeaveViewMsg() const; +}; + +MSGTARGET(CEditControlMsg); +class CEditControlMsg : public CMessage { +protected: + virtual bool handleMessage(const CEditControlMsg &msg) { return false; } +public: + int _field4; + int _field8; + CString _string1; + int _field18; + int _field1C; + int _field20; +public: + CLASSDEF + CEditControlMsg() : _field4(0), _field8(0), _field18(0), + _field1C(0), _field20(0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CEditControlMsg *>(item) != nullptr; + } + + virtual bool perform(CTreeItem *treeItem) const { + CEditControlMsg *dest = dynamic_cast<CEditControlMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CLightsMsg); +class CLightsMsg : public CMessage { +protected: + virtual bool handleMessage(const CLightsMsg &msg) { return false; } +public: + int _field4; + int _field8; + int _fieldC; + int _field10; +public: + CLASSDEF + CLightsMsg() : CMessage(), _field4(0), _field8(0), + _fieldC(0), _field10(0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CLightsMsg *>(item) != nullptr; + } + + virtual bool perform(CTreeItem *treeItem) const { + CLightsMsg *dest = dynamic_cast<CLightsMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CIsHookedOnMsg); +class CIsHookedOnMsg : public CMessage { +protected: + virtual bool handleMessage(const CIsHookedOnMsg &msg) { return false; } +public: + int _field4; + int _field8; + CString _string1; + int _field18; + int _field1C; + int _field20; +public: + CLASSDEF + CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0), + _field18(0), _field1C(0), _field20(0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CIsHookedOnMsg *>(item) != nullptr; + } + + virtual bool perform(CTreeItem *treeItem) const { + CIsHookedOnMsg *dest = dynamic_cast<CIsHookedOnMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CSubAcceptCCarryMsg); +class CSubAcceptCCarryMsg : public CMessage { +protected: + virtual bool handleMessage(const CSubAcceptCCarryMsg &msg) { return false; } +public: + CString _string1; + int _value1, _value2, _value3; +public: + CLASSDEF + CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CSubAcceptCCarryMsg *>(item) != nullptr; + } + + virtual bool perform(CTreeItem *treeItem) const { + CSubAcceptCCarryMsg *dest = dynamic_cast<CSubAcceptCCarryMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CTransportMsg); +class CTransportMsg : public CMessage { +protected: + virtual bool handleMessage(const CTransportMsg &msg) { return false; } +public: + CString _string; + int _value1, _value2; +public: + CLASSDEF + CTransportMsg() : _value1(0), _value2(0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CTransportMsg *>(item) != nullptr; + } + + virtual bool perform(CTreeItem *treeItem) const { + CTransportMsg *dest = dynamic_cast<CTransportMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +#define MESSAGE0(NAME) MSGTARGET(NAME); \ + class NAME: public CMessage { \ + public: NAME() : CMessage() {} \ + CLASSDEF \ + static bool isSupportedBy(const CTreeItem *item) { \ + return dynamic_cast<const NAME *>(item) != nullptr; } \ + virtual bool handleMessage(const NAME &msg) { return false; } \ + virtual bool perform(CTreeItem *treeItem) const { \ + NAME *dest = dynamic_cast<NAME *>(treeItem); \ + return dest != nullptr && dest->handleMessage(*this); \ + } } +#define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \ + class NAME: public CMessage { \ + public: F1 _##N1; \ + NAME() : CMessage(), _##N1(V1) {} \ + NAME(F1 N1) : CMessage(), _##N1(N1) {} \ + CLASSDEF \ + static bool isSupportedBy(const CTreeItem *item) { \ + return dynamic_cast<const NAME *>(item) != nullptr; } \ + virtual bool handleMessage(const NAME &msg) { return false; } \ + virtual bool perform(CTreeItem *treeItem) { \ + NAME *dest = dynamic_cast<NAME *>(treeItem); \ + return dest != nullptr && dest->handleMessage(*this); \ + } } +#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \ + class NAME: public CMessage { \ + public: F1 _##N1; F2 _##N2; \ + NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \ + NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \ + CLASSDEF \ + static bool isSupportedBy(const CTreeItem *item) { \ + return dynamic_cast<const NAME *>(item) != nullptr; } \ + virtual bool handleMessage(const NAME &msg) { return false; } \ + virtual bool perform(CTreeItem *treeItem) { \ + NAME *dest = dynamic_cast<NAME *>(treeItem); \ + return dest != nullptr && dest->handleMessage(*this); \ + } } +#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \ + class NAME: public CMessage { \ + public: F1 _##N1; F2 _##N2; F3 _##N3; \ + NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \ + NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \ + CLASSDEF \ + static bool isSupportedBy(const CTreeItem *item) { \ + return dynamic_cast<const NAME *>(item) != nullptr; } \ + virtual bool handleMessage(const NAME &msg) { return false; } \ + virtual bool perform(CTreeItem *treeItem) { \ + NAME *dest = dynamic_cast<NAME *>(treeItem); \ + return dest != nullptr && dest->handleMessage(*this); \ + } } +#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \ + class NAME: public CMessage { \ + public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \ + NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \ + NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \ + CLASSDEF \ + static bool isSupportedBy(const CTreeItem *item) { \ + return dynamic_cast<const NAME *>(item) != nullptr; } \ + virtual bool handleMessage(const NAME &msg) { return false; } \ + virtual bool perform(CTreeItem *treeItem) { \ + NAME *dest = dynamic_cast<NAME *>(treeItem); \ + return dest != nullptr && dest->handleMessage(*this); \ + } } + +MESSAGE1(CActMsg, CString, value, ""); +MESSAGE1(CActivationmsg, CString, value, ""); +MESSAGE1(CAddHeadPieceMsg, CString, value, "NULL"); +MESSAGE1(CAnimateMaitreDMsg, int, value, 0); +MESSAGE1(CArboretumGateMsg, int, value, 0); +MESSAGE0(CArmPickedUpFromTableMsg); +MESSAGE0(CBodyInBilgeRoomMsg); +MESSAGE1(CBowlStateChange, int, value, 0); +MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, "", int, numValue, 0); +MESSAGE1(CChangeSeasonMsg, CString, season, "Summer"); +MESSAGE0(CCheckAllPossibleCodes); +MESSAGE2(CCheckChevCode, int, value1, 0, int, value2, 0); +MESSAGE1(CChildDragEndMsg, int, value, 0); +MESSAGE2(CChildDragMoveMsg, int, value1, 0, int, value2, 0); +MESSAGE2(CChildDragStartMsg, int, value1, 0, int, value2, 0); +MESSAGE0(CClearChevPanelBits); +MESSAGE0(CCorrectMusicPlayedMsg); +MESSAGE0(CCreateMusicPlayerMsg); +MESSAGE0(CCylinderHolderReadyMsg); +MESSAGE0(CDeactivationMsg); +MESSAGE1(CDeliverCCarryMsg, CString, value, ""); +MESSAGE0(CDisableMaitreDProdReceptor); +MESSAGE0(CDismissBotMsg); +MESSAGE0(CDoffNavHelmet); +MESSAGE0(CDonNavHelmet); +MESSAGE1(CDoorbotNeededInElevatorMsg, int, value, 0); +MESSAGE0(CDoorbotNeededInHomeMsg); +MESSAGE1(CDropobjectMsg, int, value, 0); +MESSAGE1(CDropZoneGotObjectMsg, int, value, 0); +MESSAGE1(CDropZoneLostObjectMsg, int, value, 0); +MESSAGE1(CEjectCylinderMsg, int, value, 0); +MESSAGE2(CPreEnterNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr); +MESSAGE2(CPreEnterRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr); +MESSAGE2(CPreEnterViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr); +MESSAGE2(CEnterNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr); +MESSAGE2(CEnterRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr); +MESSAGE2(CEnterViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr); +MESSAGE0(CErasePhonographCylinderMsg); +MESSAGE1(CFrameMsg, uint, ticks, 0); +MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CGetChevClassBits, int, value, 0); +MESSAGE1(CGetChevClassNum, int, value, 0); +MESSAGE2(CGetChevCodeFromRoomNameMsg, CString, strValue, "", int, numValue, 0); +MESSAGE1(CGetChevFloorBits, int, value, 0); +MESSAGE1(CGetChevFloorNum, int, value, 0); +MESSAGE1(CGetChevLiftBits, int, value, 0); +MESSAGE1(CGetChevLiftNum, int, value, 0); +MESSAGE1(CGetChevRoomBits, int, value, 0); +MESSAGE1(CGetChevRoomNum, int, value, 0); +MESSAGE2(CHoseConnectedMsg, int, value1, 1, int, value2, 0); +MESSAGE0(CInitializeAnimMsg); +MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0); +MESSAGE1(CIsParrotPresentMsg, int, value, 0); +MESSAGE1(CKeyCharMsg, int, value, 32); +MESSAGE2(CLeaveNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr); +MESSAGE2(CLeaveRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr); +MESSAGE2(CLeaveViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr); +MESSAGE2(CLemonFallsFromTreeMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CLoadSuccessMsg, int, ticks, 0); +MESSAGE1(CLockPhonographMsg, int, value, 0); +MESSAGE0(CMaitreDDefeatedMsg); +MESSAGE0(CMaitreDHappyMsg); +MESSAGE1(CMissiveOMatActionMsg, int, value, 0); +MESSAGE0(CMoveToStartPosMsg); +MESSAGE2(CMovieEndMsg, int, value1, 0, int, value2, 0); +MESSAGE2(CMovieFrameMsg, int, value1, 0, int, value2, 0); +MESSAGE0(CMusicHasStartedMsg); +MESSAGE0(CMusicHasStoppedMsg); +MESSAGE0(CMusicSettingChangedMsg); +MESSAGE2(CNPCPlayAnimationMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CNPCPlayIdleAnimationMsg, int, value, 0); +MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE0(CNPCQueueIdleAnimMsg); +MESSAGE1(CNutPuzzleMsg, CString, value, ""); +MESSAGE1(COnSummonBotMsg, int, value, 0); +MESSAGE0(COpeningCreditsMsg); +MESSAGE1(CPanningAwayFromParrotMsg, int, value, 0); +MESSAGE2(CParrotSpeakMsg, CString, value1, "", CString, value2, ""); +MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0); +MESSAGE4(CPassOnDragStartMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0); +MESSAGE1(CPhonographPlayMsg, int, value, 0); +MESSAGE0(CPhonographReadyToPlayMsg); +MESSAGE1(CPhonographRecordMsg, int, value, 0); +MESSAGE3(CPhonographStopMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE2(CPlayRangeMsg, int, value1, 0, int, value2, 0); +MESSAGE2(CPlayerTriesRestaurantTableMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CPreSaveMsg, int, value, 0); +MESSAGE1(CProdMaitreDMsg, int, value, 0); +MESSAGE2(CPumpingMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CPutBotBackInHisBoxMsg, int, value, 0); +MESSAGE1(CPutParrotBackMsg, int, value, 0); +MESSAGE0(CPuzzleSolvedMsg); +MESSAGE3(CQueryCylinderHolderMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE3(CQueryCylinderMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE3(CQueryCylinderNameMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE3(CQueryCylinderTypeMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE1(CQueryMusicControlSettingMsg, int, value, 0); +MESSAGE1(CQueryPhonographState, int, value, 0); +MESSAGE0(CRecordOntoCylinderMsg); +MESSAGE0(CRemoveFromGameMsg); +MESSAGE0(CReplaceBowlAndNutsMsg); +MESSAGE1(CRestaurantMusicChanged, CString, value, ""); +MESSAGE2(CSendCCarryMsg, CString, strValue, "", int, numValue, 0); +MESSAGE1(CSenseWorkingMsg, CString, value, "Not Working"); +MESSAGE2(CServiceElevatorFloorChangeMsg, int, value1, 0, int, value2, 0); +MESSAGE0(CServiceElevatorFloorRequestMsg); +MESSAGE1(CServiceElevatorMsg, int, value, 4); +MESSAGE2(CSetChevButtonImageMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CSetChevClassBits, int, value, 0); +MESSAGE1(CSetChevFloorBits, int, value, 0); +MESSAGE1(CSetChevLiftBits, int, value, 0); +MESSAGE2(CSetChevPanelBitMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CSetChevPanelButtonsMsg, int, value, 0); +MESSAGE1(CSetChevRoomBits, int, value, 0); +MESSAGE0(CSetMusicControlsMsg); +MESSAGE2(CSetVarMsg, CString, varName, "", int, value, 0); +MESSAGE2(CSetVolumeMsg, int, value1, 70, int, value2, 0); +MESSAGE2(CShipSettingMsg, CString, strValue, "", int, numValue, 0); +MESSAGE1(CShowTextMsg, CString, value, "NO TEXT INCLUDED!!!"); +MESSAGE2(CSignalObject, CString, strValue, "", int, numValue, 0); +MESSAGE2(CSpeechFallsFromTreeMsg, int, value1, 0, int, value2, 0); +MESSAGE1(CStartMusicMsg, int, value, 0); +MESSAGE3(CStatusChangeMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE1(CStopMusicMsg, int, value, 0); +MESSAGE0(CSubDeliverCCarryMsg); +MESSAGE0(CSubSendCCarryMsg); +MESSAGE0(CSUBTransition); +MESSAGE0(CSubTurnOffMsg); +MESSAGE0(CSubTurnOnMsg); +MESSAGE2(CSummonBotMsg, CString, strValue, "", int, numValue, 0); +MESSAGE1(CSummonBotQuerryMsg, CString, value, ""); +MESSAGE1(CTakeHeadPieceMsg, CString, value, ""); +MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, ""); +MESSAGE1(CTimeDilationMsg, int, value, 0); +MESSAGE1(CTimeMsg, int, value, 0); +MESSAGE0(CTitleSequenceEndedMsg); +MESSAGE0(CTransitMsg); +MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0); +MESSAGE1(CTriggerNPCEvent, int, value, 0); +MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0); +MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, strValue, "", int, numValue, 0); +MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000); +MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0); +MESSAGE3(CTrueTalkNotifySpeechStartedMsg, int, value1, 0, int, value2, 0, int, value, 0); +MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0); +MESSAGE0(CTrueTalkSelfQueueAnimSetMsg); +MESSAGE3(CTrueTalkTriggerActionMsg, int, value1, 0, int, value2, 0, int, value3, 0); +MESSAGE0(CTurnOff); +MESSAGE0(CTurnOn); +MESSAGE1(CUse, int, value, 0); +MESSAGE1(CUseWithCharMsg, int, value, 0); +MESSAGE1(CUseWithOtherMsg, int, value, 0); +MESSAGE1(CVirtualKeyCharMsg, int, value, 0); +MESSAGE2(CVisibleMsg, int, value1, 1, int, value2, 0); + +} // End of namespace Titanic + +#endif /* TITANIC_MESSAGE_H */ diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h new file mode 100644 index 0000000000..84d7b8f61c --- /dev/null +++ b/engines/titanic/messages/mouse_messages.h @@ -0,0 +1,198 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_MOUSE_MESSAGES_H +#define TITANIC_MOUSE_MESSAGES_H + +#include "common/rect.h" +#include "titanic/messages/messages.h" + +namespace Titanic { + +enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 }; + +class CMouseMsg : public CMessage { +public: + int _buttons; + Common::Point _mousePos; +public: + CLASSDEF + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseMsg *>(item) != nullptr; + } + CMouseMsg() : _buttons(0) {} + CMouseMsg(const Common::Point &pt, int buttons) : + _mousePos(pt), _buttons(buttons) {} +}; + +MSGTARGET(CMouseMoveMsg); +class CMouseMoveMsg : public CMouseMsg { +public: + CLASSDEF + CMouseMoveMsg() : CMouseMsg() {} + CMouseMoveMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseMoveMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseMoveMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseMoveMsg *dest = dynamic_cast<CMouseMoveMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +class CMouseButtonMsg : public CMouseMsg { +public: + int _field10; +public: + CLASSDEF + CMouseButtonMsg() : CMouseMsg(), _field10(0) {} + CMouseButtonMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseButtonMsg *>(item) != nullptr; + } +}; + +MSGTARGET(CMouseButtonDownMsg); +class CMouseButtonDownMsg : public CMouseButtonMsg { +public: + CLASSDEF + CMouseButtonDownMsg() : CMouseButtonMsg() {} + CMouseButtonDownMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseButtonDownMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseButtonDownMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseButtonDownMsg *dest = dynamic_cast<CMouseButtonDownMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CMouseButtonUpMsg); +class CMouseButtonUpMsg : public CMouseButtonMsg { +public: + CLASSDEF + CMouseButtonUpMsg() : CMouseButtonMsg() {} + CMouseButtonUpMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseButtonUpMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseButtonUpMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseButtonUpMsg *dest = dynamic_cast<CMouseButtonUpMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CMouseButtonDoubleClickMsg); +class CMouseButtonDoubleClickMsg : public CMouseButtonMsg { +public: + CLASSDEF + CMouseButtonDoubleClickMsg() : CMouseButtonMsg() {} + CMouseButtonDoubleClickMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseButtonDoubleClickMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseButtonDoubleClickMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseButtonDoubleClickMsg *dest = dynamic_cast<CMouseButtonDoubleClickMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +class CMouseDragMsg : public CMouseMsg { +public: + CLASSDEF + CMouseDragMsg() : CMouseMsg() {} + CMouseDragMsg(const Common::Point &pt) : CMouseMsg(pt, 0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseDragMsg *>(item) != nullptr; + } +}; + +class CMouseDragMoveMsg : public CMouseDragMsg { +public: + CLASSDEF + CMouseDragMoveMsg() : CMouseDragMsg() {} + CMouseDragMoveMsg(const Common::Point &pt) : CMouseDragMsg(pt) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseDragMoveMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseDragMoveMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseDragMoveMsg *dest = dynamic_cast<CMouseDragMoveMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CMouseDragStartMsg); +class CMouseDragStartMsg : public CMouseDragMsg { +public: + CTreeItem *_dragItem; + int _field14; +public: + CLASSDEF + CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _field14(0) {} + CMouseDragStartMsg(const Common::Point &pt) : CMouseDragMsg(pt), + _dragItem(nullptr), _field14(0) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseDragStartMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseDragStartMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseDragStartMsg *dest = dynamic_cast<CMouseDragStartMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +MSGTARGET(CMouseDragEndMsg); +class CMouseDragEndMsg : public CMouseDragMsg { +public: + CTreeItem *_dragItem; +public: + CLASSDEF + CMouseDragEndMsg() : CMouseDragMsg(), _dragItem(nullptr) {} + CMouseDragEndMsg(const Common::Point &pt, CTreeItem *dragItem = nullptr) : + CMouseDragMsg(pt), _dragItem(dragItem) {} + + static bool isSupportedBy(const CTreeItem *item) { + return dynamic_cast<const CMouseDragEndMsg *>(item) != nullptr; + } + virtual bool handleMessage(const CMouseDragEndMsg &msg) { return false; } + virtual bool perform(CTreeItem *treeItem) { + CMouseDragEndMsg *dest = dynamic_cast<CMouseDragEndMsg *>(treeItem); + return dest != nullptr && dest->handleMessage(*this); + } +}; + +} // End of namespace Titanic + +#endif /* TITANIC_MOUSE_MESSAGES_H */ diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h new file mode 100644 index 0000000000..ac9c3ccc75 --- /dev/null +++ b/engines/titanic/messages/pet_messages.h @@ -0,0 +1,47 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_MESSAGES_H +#define TITANIC_PET_MESSAGES_H + +#include "titanic/messages/messages.h" + +namespace Titanic { + +MESSAGE0(CPETDeliverMsg); +MESSAGE0(CPETGainedObjectMsg); +MESSAGE0(CPETHelmetOnOffMsg); +MESSAGE0(CPETKeyboardOnOffMsg); +MESSAGE0(CPETLostObjectMsg); +MESSAGE0(CPETObjectSelectedMsg); +MESSAGE1(CPETObjectStateMsg, int, value, 0); +MESSAGE0(CPETPhotoOnOffMsg); +MESSAGE1(CPETPlaySoundMsg, int, value, 0); +MESSAGE0(CPETReceiveMsg); +MESSAGE0(CPETSetStarDestinationMsg); +MESSAGE1(CPETStarFieldLockMsg, int, value, 0); +MESSAGE0(CPETStereoFieldOnOffMsg); +MESSAGE2(CPETTargetMsg, CString, strValue, "", int, numValue, -1); + +} // End of namespace Titanic + +#endif /* TITANIC_PET_MESSAGES_H */ diff --git a/engines/titanic/messages/service_elevator_door.cpp b/engines/titanic/messages/service_elevator_door.cpp new file mode 100644 index 0000000000..e771f14484 --- /dev/null +++ b/engines/titanic/messages/service_elevator_door.cpp @@ -0,0 +1,48 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/messages/service_elevator_door.h" + +namespace Titanic { + +CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() { + _string1 = "z#31.wav"; + _string2 = "z#32.wav"; +} + +void CServiceElevatorDoor::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeQuotedLine(_string2, indent); + file->writeQuotedLine(_string1, indent); + + CDoorAutoSoundEvent::save(file, indent); +} + +void CServiceElevatorDoor::load(SimpleFile *file) { + file->readNumber(); + _string2 = file->readString(); + _string1 = file->readString(); + + CDoorAutoSoundEvent::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/service_elevator_door.h b/engines/titanic/messages/service_elevator_door.h new file mode 100644 index 0000000000..ac5cf5148d --- /dev/null +++ b/engines/titanic/messages/service_elevator_door.h @@ -0,0 +1,48 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H +#define TITANIC_SERVICE_ELEVATOR_DOOR_H + +#include "titanic/messages/door_auto_sound_event.h" + +namespace Titanic { + +class CServiceElevatorDoor : public CDoorAutoSoundEvent { +public: + CLASSDEF + CServiceElevatorDoor(); + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_SERVICE_ELEVATOR_DOOR_H */ |