Isle
Loading...
Searching...
No Matches
modeldb.h
Go to the documentation of this file.
1#ifndef MODELDB_H
2#define MODELDB_H
3
4#include "decomp.h"
5#include "mxlist.h"
6#include "mxstring.h"
7#include "mxtypes.h"
8
9#include <stdio.h>
10
11// SIZE 0x18
24 MxResult Read(FILE* p_file);
25
29};
30
31// VTABLE: LEGO1 0x100d6888
32// class MxCollection<ModelDbPart *>
33
34// VTABLE: LEGO1 0x100d68a0
35// class MxList<ModelDbPart *>
36
37// VTABLE: LEGO1 0x100d68b8
38// SIZE 0x1c
44class ModelDbPartList : public MxList<ModelDbPart*> {
45public:
49 ModelDbPartList() { m_unk0x18 = 1; }
50
58 MxS8 Compare(ModelDbPart* p_a, ModelDbPart* p_b) override
59 {
60 MxS32 compare = strcmpi(p_a->m_roiName.GetData(), p_b->m_roiName.GetData());
61
62 if (compare == 0) {
65 }
66
67 return compare;
68 } // vtable+0x14
69
70 // SYNTHETIC: LEGO1 0x10027d70
71 // ModelDbPartList::`scalar deleting destructor'
72
73private:
74 undefined m_unk0x18;
75};
76
77// VTABLE: LEGO1 0x100d68d0
78// class MxListCursor<ModelDbPart *>
79
80// VTABLE: LEGO1 0x100d68e8
81// SIZE 0x10
87class ModelDbPartListCursor : public MxListCursor<ModelDbPart*> {
88public:
94};
95
96// TEMPLATE: LEGO1 0x10027c70
97// MxCollection<ModelDbPart *>::Compare
98
99// TEMPLATE: LEGO1 0x10027c80
100// MxCollection<ModelDbPart *>::~MxCollection<ModelDbPart *>
101
102// TEMPLATE: LEGO1 0x10027cd0
103// MxCollection<ModelDbPart *>::Destroy
104
105// TEMPLATE: LEGO1 0x10027ce0
106// MxList<ModelDbPart *>::~MxList<ModelDbPart *>
107
108// SYNTHETIC: LEGO1 0x10027de0
109// MxCollection<ModelDbPart *>::`scalar deleting destructor'
110
111// SYNTHETIC: LEGO1 0x10027e50
112// MxList<ModelDbPart *>::`scalar deleting destructor'
113
114// SYNTHETIC: LEGO1 0x10027f00
115// ModelDbPartListCursor::`scalar deleting destructor'
116
117// TEMPLATE: LEGO1 0x10027f70
118// MxListCursor<ModelDbPart *>::~MxListCursor<ModelDbPart *>
119
120// SYNTHETIC: LEGO1 0x10027fc0
121// MxListCursor<ModelDbPart *>::`scalar deleting destructor'
122
123// TEMPLATE: LEGO1 0x10028030
124// ModelDbPartListCursor::~ModelDbPartListCursor
125
126// SIZE 0x38
137 void Free();
138
145 MxResult Read(FILE* p_file);
146
151 float m_location[3];
152 float m_direction[3];
153 float m_up[3];
155};
156
157// SIZE 0x18
169};
170
180MxResult ReadModelDbWorlds(FILE* p_file, ModelDbWorld*& p_worlds, MxS32& p_numWorlds);
181
188void FreeModelDbWorlds(ModelDbWorld*& p_worlds, MxS32 p_numWorlds);
189
190#endif // MODELDB_H
[AI] Iterator for traversing ModelDbPartList contents (ModelDbPart pointers).
Definition: modeldb.h:87
ModelDbPartListCursor(ModelDbPartList *p_list)
[AI] Constructs a cursor for the given part list, enabling iteration.
Definition: modeldb.h:93
[AI] Collection class representing a list of ModelDbPart pointers with custom comparison logic.
Definition: modeldb.h:44
MxS8 Compare(ModelDbPart *p_a, ModelDbPart *p_b) override
[AI] Compares two ModelDbPart objects by their ROI names (case-insensitive).
Definition: modeldb.h:58
ModelDbPartList()
[AI] Constructs the ModelDbPartList and initializes the unknown member.
Definition: modeldb.h:49
[AI] Forward declaration for MxListCursor.
Definition: mxlist.h:174
[AI] Forward declaration for MxList.
Definition: mxlist.h:89
Mindscape custom string class for managing dynamic C-strings within the game engine.
Definition: mxstring.h:14
char * GetData() const
Returns a pointer to the internal character buffer.
Definition: mxstring.h:110
unsigned int undefined4
Definition: decomp.h:28
unsigned char undefined
Definition: decomp.h:26
MxResult ReadModelDbWorlds(FILE *p_file, ModelDbWorld *&p_worlds, MxS32 &p_numWorlds)
[AI] Reads the collection of worlds (ModelDbWorld) from a model database file.
Definition: modeldb.cpp:90
void FreeModelDbWorlds(ModelDbWorld *&p_worlds, MxS32 p_numWorlds)
[AI] Frees all resources related to ModelDbWorlds previously allocated by ReadModelDbWorlds.
Definition: modeldb.cpp:149
MxLong MxResult
[AI]
Definition: mxtypes.h:106
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14
[AI] Represents a 3D model entry in a model database, including metadata and spatial transform info.
Definition: modeldb.h:132
char * m_presenterName
[AI] Name of the presenter/handler class used for this model, dynamically allocated....
Definition: modeldb.h:150
MxU32 m_modelDataLength
[AI] Length of the model's raw data in the file, in bytes. [AI]
Definition: modeldb.h:148
undefined m_unk0x34
[AI] Unknown field, possibly additional flags or type (purpose currently unknown)....
Definition: modeldb.h:154
char * m_modelName
[AI] Name of the model, dynamically allocated. [AI]
Definition: modeldb.h:147
float m_location[3]
[AI] World-space position of the model origin (as a 3D vector). [AI]
Definition: modeldb.h:151
float m_up[3]
[AI] World-space up vector (indicates model "up" orientation). [AI]
Definition: modeldb.h:153
MxU32 m_modelDataOffset
[AI] File offset to the model's raw data. [AI]
Definition: modeldb.h:149
float m_direction[3]
[AI] World-space direction vector (indicates model "forward" direction). [AI]
Definition: modeldb.h:152
MxResult Read(FILE *p_file)
[AI] Loads a ModelDbModel from the current file pointer.
Definition: modeldb.cpp:18
void Free()
[AI] Frees dynamically allocated memory in the model (model name and presenter name).
Definition: modeldb.cpp:11
[AI] Represents a single part within a 3D model database entry, including its name and data offsets i...
Definition: modeldb.h:17
MxString m_roiName
[AI] Name of the part/ROI this entry represents. [AI]
Definition: modeldb.h:26
undefined4 m_partDataOffset
[AI] Offset within the file to the part's data. [AI]
Definition: modeldb.h:28
undefined4 m_partDataLength
[AI] Length of binary part data in the file (in bytes). [AI]
Definition: modeldb.h:27
MxResult Read(FILE *p_file)
[AI] Reads a ModelDbPart object from a binary file.
Definition: modeldb.cpp:63
[AI] Represents a world/scene in the model database, containing its parts and models.
Definition: modeldb.h:163
MxS32 m_numModels
[AI] Number of models in the array m_models. [AI]
Definition: modeldb.h:167
ModelDbModel * m_models
[AI] Array of models within this world. [AI]
Definition: modeldb.h:166
char * m_worldName
[AI] Name of the world (scene); dynamically allocated on read. [AI]
Definition: modeldb.h:164
ModelDbPartList * m_partList
[AI] List of model parts belonging to this world. [AI]
Definition: modeldb.h:165
undefined m_unk0x10[0x08]
[AI] Unknown 8 bytes at offset 0x10; purpose and usage are currently unknown. [AI]
Definition: modeldb.h:168