aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/message_target.cpp3
-rw-r--r--engines/titanic/core/message_target.h4
-rw-r--r--engines/titanic/core/saveable_object.cpp5
3 files changed, 8 insertions, 4 deletions
diff --git a/engines/titanic/core/message_target.cpp b/engines/titanic/core/message_target.cpp
index a1060c643e..e471bc6565 100644
--- a/engines/titanic/core/message_target.cpp
+++ b/engines/titanic/core/message_target.cpp
@@ -29,8 +29,9 @@ const MSGMAP *CMessageTarget::getMessageMap() const {
}
const MSGMAP *CMessageTarget::getThisMessageMap() {
+ static const ClassDef *nullDef = nullptr;
static const MSGMAP_ENTRY _messageEntries[] = {
- { (PMSG)nullptr, nullptr }
+ { (PMSG)nullptr, &nullDef }
};
static const MSGMAP messageMap = { nullptr, &_messageEntries[0] };
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index a382b6392d..a09e6e33ec 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -34,7 +34,7 @@ typedef bool (CMessageTarget::*PMSG)(CMessage *msg);
struct MSGMAP_ENTRY {
PMSG _fn;
- ClassDef *_class;
+ const ClassDef * const *_class;
};
struct MSGMAP {
@@ -58,7 +58,7 @@ protected: \
static const MSGMAP_ENTRY _messageEntries[] = {
#define ON_MESSAGE(msgClass) \
- { static_cast<PMSG>((FNPTR)&ThisClass::msgClass), C##msgClass::_type },
+ { static_cast<PMSG>((FNPTR)&ThisClass::msgClass), &C##msgClass::_type },
#define END_MESSAGE_MAP() \
{ (PMSG)nullptr, nullptr } \
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 0257f6a087..4784151a01 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -1024,9 +1024,12 @@ void CSaveableObject::initClassList() {
_classDefs = new ClassDefList();
_classList = new ClassListMap();
+ CSaveableObject::_type = new TypeTemplate<CSaveableObject>("CSaveableObject", nullptr);
+ _classDefs->push_back(CSaveableObject::_type);
+ (*_classList)["CSaveableObject"] = FunctionCSaveableObject;
+
// Setup the type definitions for each class. Note that these have to be
// in order of hierarchy from ancestor class to descendent
- ADDFN(CSaveableObject, CSaveableObject);
ADDFN(CMessage, CSaveableObject);
ADDFN(CMessageTarget, CSaveableObject);
ADDFN(CResourceKey, CSaveableObject);