aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/messages/pet_messages.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-24 21:02:25 -0400
committerPaul Gilbert2016-03-24 21:02:25 -0400
commitc948e8812ebb619f22adb7794da6dcfb6d5d6b9e (patch)
tree8b87bcb0ceb513dcdd810dde682bf9c550e71251 /engines/titanic/messages/pet_messages.h
parentfd78a874ccfdbc652241dc4402f6ca96ca188170 (diff)
downloadscummvm-rg350-c948e8812ebb619f22adb7794da6dcfb6d5d6b9e.tar.gz
scummvm-rg350-c948e8812ebb619f22adb7794da6dcfb6d5d6b9e.tar.bz2
scummvm-rg350-c948e8812ebb619f22adb7794da6dcfb6d5d6b9e.zip
TITANIC: Support methods needed by CTelevision
Diffstat (limited to 'engines/titanic/messages/pet_messages.h')
-rw-r--r--engines/titanic/messages/pet_messages.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index ac9c3ccc75..caca53dfee 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -42,6 +42,25 @@ MESSAGE1(CPETStarFieldLockMsg, int, value, 0);
MESSAGE0(CPETStereoFieldOnOffMsg);
MESSAGE2(CPETTargetMsg, CString, strValue, "", int, numValue, -1);
+#define PET_MESSAGE(NAME) MSGTARGET(NAME); \
+ class NAME: public CPETTargetMsg { \
+ public: \
+ NAME() : CPETTargetMsg() {} \
+ NAME(const CString &name, int num) : CPETTargetMsg(name, num) {} \
+ CLASSDEF \
+ static bool isSupportedBy(const CTreeItem *item) { \
+ return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+ virtual bool perform(CTreeItem *treeItem) { \
+ NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+ return dest != nullptr && dest->handleMessage(*this); \
+ } }
+
+PET_MESSAGE(CPETDownMsg);
+PET_MESSAGE(CPETUpMsg);
+PET_MESSAGE(CPETLeftMsg);
+PET_MESSAGE(CPETRightMsg);
+PET_MESSAGE(CPETActivateMsg);
+
} // End of namespace Titanic
#endif /* TITANIC_PET_MESSAGES_H */