Isle
Loading...
Searching...
No Matches
legoworldpresenter.cpp
Go to the documentation of this file.
2
3#include "define.h"
7#include "legoentity.h"
8#include "legomain.h"
10#include "legopartpresenter.h"
11#include "legoplantmanager.h"
13#include "legovideomanager.h"
14#include "legoworld.h"
15#include "misc.h"
16#include "modeldb/modeldb.h"
18#include "mxautolock.h"
19#include "mxdsactionlist.h"
20#include "mxdschunk.h"
21#include "mxdsmediaaction.h"
22#include "mxdsmultiaction.h"
23#include "mxmisc.h"
25#include "mxobjectfactory.h"
26#include "mxpresenter.h"
27#include "mxstl/stlcompat.h"
28#include "mxutilities.h"
29
30#include <io.h>
31
33
34// GLOBAL: LEGO1 0x100f75d4
36
37// GLOBAL: LEGO1 0x100f75d8
39
40// FUNCTION: LEGO1 0x100665b0
41void LegoWorldPresenter::configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality)
42{
43 g_legoWorldPresenterQuality = p_legoWorldPresenterQuality;
44}
45
46// FUNCTION: LEGO1 0x100665c0
48{
49 m_nextObjectId = 50000;
50}
51
52// FUNCTION: LEGO1 0x10066770
54{
55 MxBool result = FALSE;
56 if (m_entity) {
57 LegoOmni::World worldId = ((LegoWorld*) m_entity)->GetWorldId();
58 PlantManager()->LoadWorldInfo(worldId);
61 result = ((LegoWorld*) m_entity)->VTable0x5c();
62 }
63
64 if (result == FALSE) {
66 }
67
68 if (m_entity) {
70 }
71}
72
73// FUNCTION: LEGO1 0x10066870
75{
77
78 MxResult result = FAILURE;
79 MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList();
80 MxObjectFactory* factory = ObjectFactory();
81 MxDSActionListCursor cursor(actions);
82 MxDSAction* action;
83
84 if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
85 cursor.Head();
86
87 while (cursor.Current(action)) {
88 MxBool success = FALSE;
89 const char* presenterName;
90 MxPresenter* presenter = NULL;
91
92 cursor.Next();
93
95 action->SetFlags(action->GetFlags() | MxDSAction::c_looping);
96 }
97 else if (m_action->GetFlags() & MxDSAction::c_bit3) {
98 action->SetFlags(action->GetFlags() | MxDSAction::c_bit3);
99 }
100
101 presenterName = PresenterNameDispatch(*action);
102 presenter = (MxPresenter*) factory->Create(presenterName);
103
104 if (presenter && presenter->AddToManager() == SUCCESS) {
105 presenter->SetCompositePresenter(this);
106 if (presenter->StartAction(p_controller, action) == SUCCESS) {
107 presenter->SetTickleState(e_idle);
108 success = TRUE;
109 }
110 }
111
112 if (success) {
113 action->SetOrigin(this);
114 m_list.push_back(presenter);
115 }
116 else if (presenter) {
117 delete presenter;
118 }
119 }
120
122
123 result = SUCCESS;
124 }
125
126 return result;
127}
128
129// FUNCTION: LEGO1 0x10066a50
131{
133 if (m_entity) {
137 }
138
139 ParseExtra();
141}
142
143// FUNCTION: LEGO1 0x10066ac0
145{
146 if (m_action->IsA("MxDSSerialAction")) {
147 MxPresenter* presenter = *m_list.begin();
148 if (presenter->GetCurrentTickleState() == e_idle) {
149 presenter->SetTickleState(e_ready);
150 }
151 }
152 else {
153 for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
154 if ((*it)->GetCurrentTickleState() == e_idle) {
155 (*it)->SetTickleState(e_ready);
156 }
157 }
158 }
159
161}
162
163// FUNCTION: LEGO1 0x10066b40
165{
166 char wdbPath[512];
167 sprintf(wdbPath, "%s", MxOmni::GetHD());
168
169 if (wdbPath[strlen(wdbPath) - 1] != '\\') {
170 strcat(wdbPath, "\\");
171 }
172
173 strcat(wdbPath, "lego\\data\\world.wdb");
174
175 if (access(wdbPath, 4) != 0) {
176 sprintf(wdbPath, "%s", MxOmni::GetCD());
177
178 if (wdbPath[strlen(wdbPath) - 1] != '\\') {
179 strcat(wdbPath, "\\");
180 }
181
182 strcat(wdbPath, "lego\\data\\world.wdb");
183
184 if (access(wdbPath, 4) != 0) {
185 return FAILURE;
186 }
187 }
188
189 ModelDbWorld* worlds = NULL;
190 MxS32 numWorlds, i, j;
191 MxU32 size;
192 MxU8* buff;
193 FILE* wdbFile = fopen(wdbPath, "rb");
194
195 if (wdbFile == NULL) {
196 return FAILURE;
197 }
198
199 ReadModelDbWorlds(wdbFile, worlds, numWorlds);
200
201 for (i = 0; i < numWorlds; i++) {
202 if (!strcmpi(worlds[i].m_worldName, p_worldName)) {
203 break;
204 }
205 }
206
207 if (i == numWorlds) {
208 return FAILURE;
209 }
210
211 if (g_wdbOffset == 0) {
212 if (fread(&size, sizeof(size), 1, wdbFile) != 1) {
213 return FAILURE;
214 }
215
216 buff = new MxU8[size];
217 if (fread(buff, size, 1, wdbFile) != 1) {
218 return FAILURE;
219 }
220
221 MxDSChunk chunk;
222 chunk.SetLength(size);
223 chunk.SetData(buff);
224
225 LegoTexturePresenter texturePresenter;
226 if (texturePresenter.Read(chunk) == SUCCESS) {
227 texturePresenter.Store();
228 }
229
230 delete[] buff;
231
232 if (fread(&size, sizeof(size), 1, wdbFile) != 1) {
233 return FAILURE;
234 }
235
236 buff = new MxU8[size];
237 if (fread(buff, size, 1, wdbFile) != 1) {
238 return FAILURE;
239 }
240
241 chunk.SetLength(size);
242 chunk.SetData(buff);
243
244 LegoPartPresenter partPresenter;
245 if (partPresenter.Read(chunk) == SUCCESS) {
246 partPresenter.Store();
247 }
248
249 delete[] buff;
250
251 g_wdbOffset = ftell(wdbFile);
252 }
253 else {
254 if (fseek(wdbFile, g_wdbOffset, SEEK_SET) != 0) {
255 return FAILURE;
256 }
257 }
258
259 ModelDbPartListCursor cursor(worlds[i].m_partList);
260 ModelDbPart* part;
261
262 while (cursor.Next(part)) {
263 if (GetViewLODListManager()->Lookup(part->m_roiName.GetData()) == NULL &&
264 LoadWorldPart(*part, wdbFile) != SUCCESS) {
265 return FAILURE;
266 }
267 }
268
269 for (j = 0; j < worlds[i].m_numModels; j++) {
270 if (!strnicmp(worlds[i].m_models[j].m_modelName, "isle", 4)) {
272 case 0:
273 if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_lo")) {
274 continue;
275 }
276 break;
277 case 1:
278 if (strcmpi(worlds[i].m_models[j].m_modelName, "isle")) {
279 continue;
280 }
281 break;
282 case 2:
283 if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_hi")) {
284 continue;
285 }
286 }
287 }
288 else if (g_legoWorldPresenterQuality <= 1 && !strnicmp(worlds[i].m_models[j].m_modelName, "haus", 4)) {
289 if (worlds[i].m_models[j].m_modelName[4] == '3') {
290 if (LoadWorldModel(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
291 return FAILURE;
292 }
293
294 if (LoadWorldModel(worlds[i].m_models[j - 2], wdbFile, p_world) != SUCCESS) {
295 return FAILURE;
296 }
297
298 if (LoadWorldModel(worlds[i].m_models[j - 1], wdbFile, p_world) != SUCCESS) {
299 return FAILURE;
300 }
301 }
302
303 continue;
304 }
305
306 if (LoadWorldModel(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
307 return FAILURE;
308 }
309 }
310
311 FreeModelDbWorlds(worlds, numWorlds);
312 fclose(wdbFile);
313 return SUCCESS;
314}
315
316// FUNCTION: LEGO1 0x10067360
317MxResult LegoWorldPresenter::LoadWorldPart(ModelDbPart& p_part, FILE* p_wdbFile)
318{
319 MxResult result;
320 MxU8* buff = new MxU8[p_part.m_partDataLength];
321
322 fseek(p_wdbFile, p_part.m_partDataOffset, SEEK_SET);
323 if (fread(buff, p_part.m_partDataLength, 1, p_wdbFile) != 1) {
324 return FAILURE;
325 }
326
327 MxDSChunk chunk;
328 chunk.SetLength(p_part.m_partDataLength);
329 chunk.SetData(buff);
330
331 LegoPartPresenter partPresenter;
332 result = partPresenter.Read(chunk);
333
334 if (result == SUCCESS) {
335 partPresenter.Store();
336 }
337
338 delete[] buff;
339 return result;
340}
341
342// FUNCTION: LEGO1 0x100674b0
343MxResult LegoWorldPresenter::LoadWorldModel(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world)
344{
345 MxU8* buff = new MxU8[p_model.m_modelDataLength];
346
347 fseek(p_wdbFile, p_model.m_modelDataOffset, SEEK_SET);
348 if (fread(buff, p_model.m_modelDataLength, 1, p_wdbFile) != 1) {
349 return FAILURE;
350 }
351
352 MxDSChunk chunk;
353 chunk.SetLength(p_model.m_modelDataLength);
354 chunk.SetData(buff);
355
356 MxDSAction action;
357 MxAtomId atom;
358 action.SetLocation(p_model.m_location);
359 action.SetDirection(p_model.m_direction);
360 action.SetUp(p_model.m_up);
361
362 MxU32 objectId = m_nextObjectId;
363 m_nextObjectId++;
364 action.SetObjectId(objectId);
365
366 action.SetAtomId(atom);
367
368 LegoEntity* createdEntity = NULL;
369
370 if (!strcmp(p_model.m_presenterName, "LegoActorPresenter")) {
371 LegoActorPresenter presenter;
372 presenter.SetAction(&action);
373 LegoEntity* entity = (LegoEntity*) presenter.CreateEntity("LegoActor");
374 presenter.SetInternalEntity(entity);
375 presenter.SetEntityLocation(p_model.m_location, p_model.m_direction, p_model.m_up);
376 entity->Create(action);
377 }
378 else if (!strcmp(p_model.m_presenterName, "LegoEntityPresenter")) {
379 LegoEntityPresenter presenter;
380 presenter.SetAction(&action);
381 createdEntity = (LegoEntity*) presenter.CreateEntity("LegoEntity");
382 presenter.SetInternalEntity(createdEntity);
383 presenter.SetEntityLocation(p_model.m_location, p_model.m_direction, p_model.m_up);
384 createdEntity->Create(action);
385 }
386
387 LegoModelPresenter modelPresenter;
388
389 if (createdEntity != NULL) {
390 action.SetLocation(Mx3DPointFloat(0.0, 0.0, 0.0));
391 action.SetUp(Mx3DPointFloat(0.0, 0.0, 1.0));
392 action.SetDirection(Mx3DPointFloat(0.0, 1.0, 0.0));
393 }
394
395 modelPresenter.SetAction(&action);
396 modelPresenter.FUN_1007ff70(chunk, createdEntity, p_model.m_unk0x34, p_world);
397 delete[] buff;
398
399 return SUCCESS;
400}
401
402// FUNCTION: LEGO1 0x10067a70
404{
406 MxDSAction* action = p_presenter->GetAction();
407
408 if (action->GetDuration() != -1 && (action->GetFlags() & MxDSAction::c_looping) == 0) {
409 if (!action->IsA("MxDSMediaAction")) {
410 return;
411 }
412
413 if (((MxDSMediaAction*) action)->GetSustainTime() != -1) {
414 return;
415 }
416 }
417
418 if (!p_presenter->IsA("LegoAnimPresenter") && !p_presenter->IsA("MxControlPresenter") &&
419 !p_presenter->IsA("MxCompositePresenter")) {
420 p_presenter->SendToCompositePresenter(Lego());
421 ((LegoWorld*) m_entity)->Add(p_presenter);
422 }
423}
424
425// FUNCTION: LEGO1 0x10067b00
427{
428 MxU16 extraLength;
429 char* extraData;
430 m_action->GetExtra(extraLength, extraData);
431
432 if (extraLength) {
433 char extraCopy[1024];
434 memcpy(extraCopy, extraData, extraLength);
435 extraCopy[extraLength] = '\0';
436
437 char output[1024];
438 if (KeyValueStringParse(output, g_strWORLD, extraCopy)) {
439 char* worldKey = strtok(output, g_parseExtraTokens);
440 LoadWorld(worldKey, (LegoWorld*) m_entity);
441 ((LegoWorld*) m_entity)->SetWorldId(Lego()->GetWorldId(worldKey));
442 }
443 }
444}
[AI] Handles presentation logic specific to LegoActor entities, such as their instantiation,...
MxResult LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all world animation and extra info.
void LoadWorldInfo()
[AI] Loads/creates building models for the current world, sets up variants appropriately for current ...
[AI] Presenter responsible for managing the lifecycle, location, and logic for a LegoEntity instance ...
void SetInternalEntity(LegoEntity *p_entity)
[AI] Directly sets the internal LegoEntity pointer without instantiating or taking ownership.
LegoEntity * m_entity
[AI] The entity instance managed by this presenter, typically created based on the current action.
void SetEntityLocation(const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up)
[AI] Sets the entity's world transformation using location, direction, and up vectors.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
virtual MxResult Create(MxDSAction &p_dsAction)
[AI] Initializes the entity from a DSAction object, typically from a script or file load.
Definition: legoentity.cpp:84
[AI] Presenter class for managing 3D model (ROI) presentation and their relationship with entities in...
MxResult FUN_1007ff70(MxDSChunk &p_chunk, LegoEntity *p_entity, MxBool p_roiVisible, LegoWorld *p_world)
[AI] Loads or associates an ROI for presentation from a chunk, linking it to a LegoEntity or LegoWorl...
void AddWorld(LegoWorld *p_world)
[AI] Appends a LegoWorld to the active world list, acquiring ownership.
Definition: legomain.cpp:311
@ c_clearScreen
[AI] When set, clears the display surface. [AI]
Definition: legomain.h:49
@ c_disable3d
[AI] When set, disables 3D rendering. [AI]
Definition: legomain.h:48
@ c_disableInput
[AI] When set, disables input processing. [AI]
Definition: legomain.h:47
World
[AI] Identifiers for all unique, script-driven world environments in LEGO Island.
Definition: legomain.h:57
World GetWorldId(const char *p_key)
[AI] Looks up a World enum id from its string key.
Definition: legomain.cpp:505
[AI] Presents and loads Lego part definitions from SI chunks and manages their installation in ViewLO...
MxResult Read(MxDSChunk &p_chunk)
[AI] Reads Lego part and texture data from a MxDSChunk and builds internal part list.
void Store()
[AI] Transfers all loaded named Lego parts and LODs to the ViewLODListManager.
void LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all plant objects/entities for the requested world, instantiates requisite ROIs and entiti...
[AI] Manages the loading, storage, and management of named textures for the LEGO Island engine.
MxResult Read(MxDSChunk &p_chunk)
[AI] Loads and parses one or more texture objects from a provided serialized data chunk.
MxResult Store()
[AI] Transfers all loaded textures to the global texture container and initializes their info structu...
[AI] Presenter for the entire LEGO world, responsible for loading, parsing, and managing world entiti...
void ReadyTickle() override
[AI] Tickle when in "ready" state: creates the LegoWorld entity, places it into the system,...
LegoWorldPresenter()
[AI] Constructs a LegoWorldPresenter with initial objectId for presented models.
MxResult StartAction(MxStreamController *p_controller, MxDSAction *p_action) override
[AI] Starts the world presentation process: creates child presenters for every sub-action (often part...
MxResult LoadWorld(char *p_worldName, LegoWorld *p_world)
[AI] Loads all data for a named world from the world database (WDB) file, creates all parts and model...
void StartingTickle() override
[AI] Tickle when in "starting" state: signals child presenters to move to "ready" if idle,...
void ParseExtra() override
[AI] Parses extra data attached to the current action, such as selecting which world to load from the...
~LegoWorldPresenter() override
[AI] Destructor; unregisters, cleans up associated world, reverts system managers to previous state,...
void VTable0x60(MxPresenter *p_presenter) override
[AI] Handles completion and composition of a presenter's child (typically model/entity),...
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
[AI] Iterator for traversing ModelDbPartList contents (ModelDbPart pointers).
Definition: modeldb.h:87
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
MxCompositePresenterList m_list
[AI] List of owned child presenters that are managed by this MxCompositePresenter....
virtual void VTable0x60(MxPresenter *p_presenter)
[AI] Advance sequencing for serial multi-actions: promotes the next presenter in sequence to e_ready ...
[AI] Convenience cursor class for iterating over an MxDSActionList.
[AI] A list (collection) of pointers to MxDSAction objects, supporting comparison,...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
Definition: mxdsaction.h:177
void SetLocation(const Vector3 &p_location)
[AI] Sets the location vector for this action.
Definition: mxdsaction.h:231
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
Definition: mxdsaction.h:168
MxBool IsA(const char *p_name) const override
[AI] Run-time type check, compares provided name with this or any ancestor type.
Definition: mxdsaction.h:80
void SetDirection(const Vector3 &p_direction)
[AI] Sets the direction vector for this action.
Definition: mxdsaction.h:237
void SetOrigin(MxCore *p_origin)
[AI] Sets the origin core pointer for this action, if spatially transforming/localizing this action.
Definition: mxdsaction.h:265
const Vector3 & GetLocation()
[AI] Gets the location vector for this action (world or local space).
Definition: mxdsaction.h:215
void SetFlags(MxU32 p_flags)
[AI] Sets the flag bitmask controlling action logic (enabled, looping, etc).
Definition: mxdsaction.h:183
const Vector3 & GetUp()
[AI] Gets the up vector for this action (global or local).
Definition: mxdsaction.h:225
const Vector3 & GetDirection()
[AI] Gets the direction vector (typically forward vector) for this action.
Definition: mxdsaction.h:220
virtual MxLong GetDuration()
[AI] Gets the duration for which this action is intended to run.
Definition: mxdsaction.cpp:39
void SetUp(const Vector3 &p_up)
[AI] Sets the up vector for this action.
Definition: mxdsaction.h:243
@ c_looping
[AI] Action or media should repeat in a loop [AI]
Definition: mxdsaction.h:21
@ c_bit3
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:22
[AI] Represents a chunk of data extracted from a stream (typically from a Mindscape/Mx SI file or str...
Definition: mxdschunk.h:38
void SetData(MxU8 *p_data)
[AI] Sets the pointer to the raw payload data (may or may not be owned by chunk object).
Definition: mxdschunk.h:93
void SetLength(MxU32 p_length)
[AI] Sets the payload data length for this chunk.
Definition: mxdschunk.h:89
MxDSMediaAction extends MxDSAction to add media-specific playback properties and management.
[AI] Represents a container for multiple MxDSAction objects, facilitating the grouping and management...
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
MxBool Next()
[AI]
MxBool Head()
[AI]
Definition: mxlist.h:252
MxBool Current(T &p_obj)
[AI]
virtual void RegisterPresenter(MxPresenter &p_presenter)
[AI] Register a new presenter for tickle management and playback coordination.
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
[AI] Forward declaration for the factory responsible for constructing core objects from atom or type ...
virtual MxCore * Create(const char *p_name)
[AI] Creates a new instance of the class matching the provided string name.
static const char * GetCD()
[AI] Retrieves the configured CD-ROM media path string used for resource location.
Definition: mxomni.cpp:375
static const char * GetHD()
[AI] Retrieves the configured hard disk media path string used for resource location.
Definition: mxomni.cpp:363
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
virtual void SetTickleState(TickleState p_tickleState)
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
Definition: mxpresenter.h:100
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
Definition: mxpresenter.h:72
virtual MxResult StartAction(MxStreamController *, MxDSAction *)
[AI] Initiates presenter for a new action, setting up context and state.
Definition: mxpresenter.cpp:45
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
MxS32 GetCurrentTickleState() const
[AI] Returns the current tickle state.
Definition: mxpresenter.h:160
void SetAction(MxDSAction *p_action)
[AI] Sets the action associated with this presenter.
Definition: mxpresenter.h:179
MxEntity * CreateEntity(const char *p_defaultName)
[AI] Creates an entity based on action 'extra' data, or uses the provided default name.
@ e_idle
[AI] Not processing an action.
Definition: mxpresenter.h:24
@ e_ready
[AI] Prepared to start processing an action.
Definition: mxpresenter.h:25
@ e_starting
[AI] In the process of starting playback/presentation.
Definition: mxpresenter.h:26
@ e_streaming
[AI] Streaming or rendering actively.
Definition: mxpresenter.h:27
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
Definition: mxpresenter.h:214
MxBool IsA(const char *p_name) const override
[AI] Determines if this object is of (or inherits) the specified named class.
Definition: mxpresenter.h:141
virtual MxResult AddToManager()
[AI] Optional registration with a manager (such as TickleManager); by default does nothing.
Definition: mxpresenter.h:84
void SendToCompositePresenter(MxOmni *p_omni)
[AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group.
void SetCompositePresenter(MxCompositePresenter *p_compositePresenter)
[AI] Sets the composite presenter to notify/join on completion.
Definition: mxpresenter.h:183
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
char * GetData() const
Returns a pointer to the internal character buffer.
Definition: mxstring.h:110
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
Definition: define.cpp:141
const char * g_strWORLD
[AI] Symbolic name used to reference a "WORLD" entity or property in scripts and object definitions.
Definition: define.cpp:125
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
MxS32 g_legoWorldPresenterQuality
MxLong g_wdbOffset
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
Definition: misc.cpp:123
ViewLODListManager * GetViewLODListManager()
[AI] Returns the global ViewLODListManager for view LOD (Level of Detail) resources....
Definition: misc.cpp:136
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
Definition: misc.cpp:115
void FUN_10015820(MxBool p_disable, MxU16 p_flags)
[AI] Utility for enabling or disabling functionality in LegoOmni based on certain flags.
Definition: misc.cpp:143
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
Definition: misc.cpp:16
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
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
Definition: mxautolock.h:5
MxObjectFactory * ObjectFactory()
[AI] Returns the factory for creating core engine objects from atom/type ids.
Definition: mxmisc.cpp:9
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
@ c_notificationNewPresenter
[AI] Notification about a new Presenter object [AI]
const char * PresenterNameDispatch(const MxDSAction &)
[AI] Provides a mapping from action object/type to the correct presenter handler class name based on ...
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
Definition: mxutilities.cpp:85
[AI] STL compatibility layer header to provide consistent STL (Standard Template Library) types and a...
[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
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
[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
[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