Isle
Loading...
Searching...
No Matches
mxdsobject.h
Go to the documentation of this file.
1#ifndef MXDSOBJECT_H
2#define MXDSOBJECT_H
3
4#include "decomp.h"
5#include "mxatom.h"
6#include "mxcore.h"
7#include "mxutilitylist.h"
8
9class MxDSFile;
10class MxDSObject;
11class MxPresenter;
12
17// SIZE 0x0c
18class MxDSObjectList : public MxUtilityList<MxDSObject*> {
19public:
23 MxDSObject* FindAndErase(MxDSObject* p_action) { return FindInternal(p_action, TRUE); }
24
28 MxDSObject* Find(MxDSObject* p_action) { return FindInternal(p_action, FALSE); }
29
30private:
35 MxDSObject* FindInternal(MxDSObject* p_action, MxBool p_delete);
36};
37
41// VTABLE: LEGO1 0x100dc868
42// VTABLE: BETA10 0x101c23f0
43// SIZE 0x2c
44class MxDSObject : public MxCore {
45public:
48 enum Type {
61 };
62
64 MxDSObject();
65
67 ~MxDSObject() override;
68
71 void CopyFrom(MxDSObject& p_dsObject);
72
75 MxDSObject(MxDSObject& p_dsObject);
76
80 MxDSObject& operator=(MxDSObject& p_dsObject);
81
84 void SetObjectName(const char* p_objectName);
85
88 void SetSourceName(const char* p_sourceName);
89
92 const char* ClassName() const override { return "MxDSObject"; } // vtable+0x0c
93
97 MxBool IsA(const char* p_name) const override
98 {
99 return !strcmp(p_name, MxDSObject::ClassName()) || MxCore::IsA(p_name);
100 } // vtable+0x10
101
104 virtual undefined4 VTable0x14(); // vtable+0x14
105
108 virtual MxU32 GetSizeOnDisk(); // vtable+0x18
109
114 virtual void Deserialize(MxU8*& p_source, MxS16 p_unk0x24); // vtable+0x1c
115
118 virtual void SetAtomId(MxAtomId p_atomId) { m_atomId = p_atomId; } // vtable+0x20
119
121 Type GetType() const { return (Type) m_type; }
122
124 const char* GetSourceName() const { return m_sourceName; }
125
127 const char* GetObjectName() const { return m_objectName; }
128
131
133 const MxAtomId& GetAtomId() { return m_atomId; }
134
137
140
143 void SetType(Type p_type) { m_type = p_type; }
144
147 void SetObjectId(MxU32 p_objectId) { m_objectId = p_objectId; }
148
151 void SetUnknown24(MxS16 p_unk0x24) { m_unk0x24 = p_unk0x24; }
152
155 void SetUnknown28(MxPresenter* p_unk0x28) { m_unk0x28 = p_unk0x28; }
156
159
160 // SYNTHETIC: LEGO1 0x100bf7c0
161 // SYNTHETIC: BETA10 0x10148770
162 // MxDSObject::`scalar deleting destructor'
163
164protected:
174};
175
181
187
188// TEMPLATE: BETA10 0x10150950
189// MxUtilityList<MxDSObject *>::PopFront
190
191#endif // MXDSOBJECT_H
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
void Clear()
[AI] Disassociates the atom ID from any atom (decrements reference count, sets internal pointer to NU...
Definition: mxatom.cpp:122
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
[AI] Represents a source file handler for SI (Streamer Interface) files, providing buffered access fo...
Definition: mxdsfile.h:20
[AI] Utility list for managing dynamic sequence (DS) objects, provides search and removal by pointer ...
Definition: mxdsobject.h:18
MxDSObject * FindAndErase(MxDSObject *p_action)
[AI] Finds the matching object and removes it from the list.
Definition: mxdsobject.h:23
MxDSObject * Find(MxDSObject *p_action)
[AI] Finds a matching object in the list without removing it.
Definition: mxdsobject.h:28
[AI] Base class for any object deserialized from an SI (script/data) file in the LEGO Island engine.
Definition: mxdsobject.h:44
const char * GetObjectName() const
[AI] Returns the object name string.
Definition: mxdsobject.h:127
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
char * m_sourceName
[AI] Heap copy: SI file or source identifier string. [AI]
Definition: mxdsobject.h:167
MxDSObject()
[AI] Default constructor. Initializes to e_object and clears names and pointers.
Definition: mxdsobject.cpp:25
void SetUnknown28(MxPresenter *p_unk0x28)
[AI] Sets the pointer at 0x28 (presenter or handler).
Definition: mxdsobject.h:155
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
MxPresenter * m_unk0x28
[AI] Presenter or handler associated to this object (may be null). [AI]
Definition: mxdsobject.h:173
MxS16 m_unk0x24
[AI] Unknown usage, possibly used for context or flags during loading. [AI]
Definition: mxdsobject.h:172
void SetSourceName(const char *p_sourceName)
[AI] Sets the source name (usually source SI file); deep copies the string.
Definition: mxdsobject.cpp:99
undefined4 m_unk0x14
[AI] Unknown usage, possibly flags or reserved SI-format field. [AI]
Definition: mxdsobject.h:168
~MxDSObject() override
[AI] Destructor. Frees allocated objectName/sourceName memory.
Definition: mxdsobject.cpp:38
MxBool IsA(const char *p_name) const override
[AI] Runtime type check; supports derived/parent class lookup by name.
Definition: mxdsobject.h:97
MxDSObject & operator=(MxDSObject &p_dsObject)
[AI] Assignment operator.
Definition: mxdsobject.cpp:65
const char * ClassName() const override
[AI] Returns the class identifier string for run-time type ID.
Definition: mxdsobject.h:92
Type
[AI] Enumerated type value for each kind of DS object.
Definition: mxdsobject.h:48
@ e_serialAction
[AI] Series of actions to play in order. [AI]
Definition: mxdsobject.h:55
@ e_objectAction
[AI] Placeholder for generic object operations. [AI]
Definition: mxdsobject.h:60
@ e_still
[AI] Still image resource. [AI]
Definition: mxdsobject.h:59
@ e_object
[AI] Base object, most basic type. [AI]
Definition: mxdsobject.h:49
@ e_parallelAction
[AI] Parallel (simultaneous) action list. [AI]
Definition: mxdsobject.h:56
@ e_multiAction
[AI] Composite/multi-action list. [AI]
Definition: mxdsobject.h:54
@ e_sound
[AI] Sound resource reference or cue. [AI]
Definition: mxdsobject.h:53
@ e_selectAction
[AI] Selects an action from several (with rules/random). [AI]
Definition: mxdsobject.h:58
@ e_anim
[AI] Animation sequence or reference. [AI]
Definition: mxdsobject.h:52
@ e_action
[AI] Simple action or command invocation. [AI]
Definition: mxdsobject.h:50
@ e_mediaAction
[AI] Media-related action (usually for videos, audio, etc). [AI]
Definition: mxdsobject.h:51
@ e_event
[AI] Scripted event type. [AI]
Definition: mxdsobject.h:57
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
Definition: mxdsobject.h:151
Type GetType() const
[AI] Returns the object's type enum as stored in m_type.
Definition: mxdsobject.h:121
MxU32 m_sizeOnDisk
[AI] Cached/calculated disk size of object data for serialization. [AI]
Definition: mxdsobject.h:165
virtual MxU32 GetSizeOnDisk()
[AI] Calculates serialized size of this object on disk (for buffer allocation).
Definition: mxdsobject.cpp:129
void SetType(Type p_type)
[AI] Sets the DS object type.
Definition: mxdsobject.h:143
void SetObjectName(const char *p_objectName)
[AI] Sets object (internal) unique name; deep copies the string.
Definition: mxdsobject.cpp:77
void ClearAtom()
[AI] Clears the atom id, releasing its association.
Definition: mxdsobject.h:158
MxU32 m_objectId
[AI] Numeric id (unique per file or context, often -1). [AI]
Definition: mxdsobject.h:170
virtual void Deserialize(MxU8 *&p_source, MxS16 p_unk0x24)
[AI] Initializes this object from serialized (memory buffer) data.
Definition: mxdsobject.cpp:159
MxPresenter * GetUnknown28()
[AI] Returns the pointer stored at 0x28, likely a presenter or handler for this DS object.
Definition: mxdsobject.h:139
void CopyFrom(MxDSObject &p_dsObject)
[AI] Copy data from another MxDSObject, performing deep string copy for names.
Definition: mxdsobject.cpp:46
virtual undefined4 VTable0x14()
[AI] Placeholder for early vtable slot (purpose unknown, may be used for RTTI).
Definition: mxdsobject.cpp:121
MxS16 GetUnknown24()
[AI] Returns the unknown 0x24 value (may be data version or usage state). [AI]
Definition: mxdsobject.h:136
char * m_objectName
[AI] Heap copy: Logical object name as referenced in script/data. [AI]
Definition: mxdsobject.h:169
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
MxAtomId m_atomId
[AI] String/value pair for engine lookup/reference. [AI]
Definition: mxdsobject.h:171
const char * GetSourceName() const
[AI] Returns the source name string (typically the originating SI file).
Definition: mxdsobject.h:124
MxU16 m_type
[AI] Object type enum (see Type) as read from data or set in code. [AI]
Definition: mxdsobject.h:166
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
[AI] A utility list extending the STL list<T>, providing simplified PushBack, Remove,...
Definition: mxutilitylist.h:14
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
unsigned int undefined4
Definition: decomp.h:28
MxDSObject * DeserializeDSObjectDispatch(MxU8 *&, MxS16)
[AI] Reads and deserializes a DS object of the specific type from an SI buffer.
Definition: mxdsobject.cpp:210
MxDSObject * CreateStreamObject(MxDSFile *, MxS16)
[AI] Creates and deserializes a stream object from a chunk inside a DS file.
Definition: mxdsobject.cpp:266
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32