Isle
Loading...
Searching...
No Matches
legoworld.h
Go to the documentation of this file.
1#ifndef LEGOWORLD_H
2#define LEGOWORLD_H
3
4// clang-format off
5#include "mxpresenterlist.h"
6#include "legoentitylist.h"
8// clang-format on
9
10#include "legoentity.h"
11#include "legomain.h"
13#include "roi/legoroi.h"
14
18
19#if defined(_M_IX86) || defined(__i386__)
20#define COMPARE_POINTER_TYPE MxS32
21#else
22#define COMPARE_POINTER_TYPE MxS32*
23#endif
24
31 MxS32 operator()(MxCore* const& p_a, MxCore* const& p_b) const
32 {
33 return (COMPARE_POINTER_TYPE) p_a < (COMPARE_POINTER_TYPE) p_b;
34 }
35};
36
40typedef set<MxCore*, CoreSetCompare> MxCoreSet;
41
49class LegoWorld : public LegoEntity {
50public:
55 e_start = 0,
59 e_four
60 };
61
65 LegoWorld();
66
70 ~LegoWorld() override; // vtable+0x00
71
77 MxLong Notify(MxParam& p_param) override; // vtable+0x04
78
84 MxResult Tickle() override; // vtable+0x08
85
91 MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
92
97 void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
98
102 virtual void ReadyWorld(); // vtable+0x50
103
108 virtual LegoCameraController* VTable0x54(); // vtable+0x54
109
114 virtual void Add(MxCore* p_object); // vtable+0x58
115
120 virtual MxBool VTable0x5c() { return FALSE; } // vtable+0x5c
121
125 virtual void VTable0x60() {} // vtable+0x60
126
131 virtual MxBool Escape() { return FALSE; } // vtable+0x64
132
137 virtual void Enable(MxBool p_enable); // vtable+0x68
138
143 const char* ClassName() const override // vtable+0x0c
144 {
145 return "LegoWorld";
146 }
147
153 MxBool IsA(const char* p_name) const override // vtable+0x10
154 {
155 return !strcmp(p_name, LegoWorld::ClassName()) || LegoEntity::IsA(p_name);
156 }
157
163
168 void Remove(MxCore* p_object);
169
181 LegoPathActor* p_actor,
182 const char* p_name,
183 MxS32 p_src,
184 float p_srcScale,
185 MxS32 p_dest,
186 float p_destScale
187 );
188
195
205 LegoPathActor* p_actor,
206 LegoAnimPresenter* p_presenter,
207 Vector3& p_position,
208 Vector3& p_direction
209 );
210
215 void RemoveActor(LegoPathActor* p_actor);
216
223
228 void FUN_1001fda0(LegoAnimPresenter* p_presenter); // [AI_SUGGESTED_NAME: ForwardHideAnimationToControllers]
229
234 void FUN_1001fe90(LegoAnimPresenter* p_presenter); // [AI_SUGGESTED_NAME: ForwardShowAnimationToControllers]
235
241 LegoPathBoundary* FindPathBoundary(const char* p_name);
242
247 void AddPath(LegoPathController* p_controller);
248
255 MxResult GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_numL);
256
263 MxCore* Find(const char* p_class, const char* p_name);
264
271 MxCore* Find(const MxAtomId& p_atom, MxS32 p_entityId);
272
278
284
290
295 MxBool GetUnknown0xd0Empty() { return m_set0xd0.empty(); } // [AI_SUGGESTED_NAME: IsPausedSetEmpty]
296
301 list<LegoROI*>& GetROIList() { return m_roiList; }
302
308
313 void SetWorldId(LegoOmni::World p_worldId) { m_worldId = p_worldId; }
314
315 // SYNTHETIC: LEGO1 0x1001dee0
316 // LegoWorld::`scalar deleting destructor'
317
318protected:
323
328
333
338
343
348
353
358
364
368 list<LegoROI*> m_roiList; // 0xe0
369
374
379
384
389
394};
395
396// clang-format off
397// TEMPLATE: LEGO1 0x1001d780
398// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::~_Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >
399
400// TEMPLATE: LEGO1 0x1001d850
401// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::iterator::_Inc
402
403// TEMPLATE: LEGO1 0x1001d890
404// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::erase
405
406// TEMPLATE: LEGO1 0x1001dcf0
407// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Erase
408
409// TEMPLATE: LEGO1 0x1001dd30
410// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Init
411
412// TEMPLATE: LEGO1 0x1001ddf0
413// list<LegoROI *,allocator<LegoROI *> >::~list<LegoROI *,allocator<LegoROI *> >
414
415// TEMPLATE: LEGO1 0x1001df50
416// List<LegoROI *>::~List<LegoROI *>
417
418// TEMPLATE: LEGO1 0x1001de60
419// list<LegoROI *,allocator<LegoROI *> >::_Buynode
420
421// TEMPLATE: LEGO1 0x1001de90
422// set<MxCore *,CoreSetCompare,allocator<MxCore *> >::~set<MxCore *,CoreSetCompare,allocator<MxCore *> >
423
424// TEMPLATE: LEGO1 0x1001df00
425// Set<MxCore *,CoreSetCompare>::~Set<MxCore *,CoreSetCompare>
426
427// TEMPLATE: LEGO1 0x1001f590
428// list<LegoROI *,allocator<LegoROI *> >::erase
429
430// TEMPLATE: LEGO1 0x100208b0
431// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::insert
432
433// TEMPLATE: LEGO1 0x10020b20
434// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::iterator::_Dec
435
436// TEMPLATE: LEGO1 0x10020b70
437// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::lower_bound
438
439// TEMPLATE: LEGO1 0x10020bb0
440// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Buynode
441
442// TEMPLATE: LEGO1 0x10020bd0
443// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Insert
444
445// TEMPLATE: LEGO1 0x10020e50
446// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Lrotate
447
448// TEMPLATE: LEGO1 0x10020eb0
449// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Rrotate
450
451// TEMPLATE: LEGO1 0x10021340
452// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::find
453
454// TEMPLATE: LEGO1 0x10022360
455// ?_Construct@@YAXPAPAVMxCore@@ABQAV1@@Z
456
457// GLOBAL: LEGO1 0x100f11a0
458// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Nil
459// clang-format on
460
461#endif // LEGOWORLD_H
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
[AI] Specialized pointer list for managing a collection of LegoCacheSound objects,...
Camera controller for 3D scenes, handles interactive camera manipulation and view transformation.
[AI] A strongly typed list for holding LegoEntity pointers.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
MxBool IsA(const char *p_name) const override
[AI] Polymorphic type check for this entity given a string.
Definition: legoentity.h:59
[AI] Presenter class responsible for controlling animations that hide or show actors based on animati...
World
[AI] Identifiers for all unique, script-driven world environments in LEGO Island.
Definition: legomain.h:57
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
Class representing a list of pointers to LegoPathController objects, with optional ownership semantic...
[AI] Manager for controlling actors' movement along predefined geometric paths.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
undefined m_unk0xf7
Unknown, probably flags or padding.
Definition: legoworld.h:393
void SetWorldId(LegoOmni::World p_worldId)
Sets the world id for this world instance.
Definition: legoworld.h:313
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
Definition: legoworld.cpp:508
virtual void ReadyWorld()
Called when the world is ready to be used—typically for custom scene setup after startup.
Definition: legoworld.cpp:874
virtual void VTable0x60()
Placeholder/extensible virtual—default does nothing.
Definition: legoworld.h:125
LegoOmni::World m_worldId
Currently assigned world id, corresponding to an enum in LegoOmni.
Definition: legoworld.h:373
MxResult GetCurrPathInfo(LegoPathBoundary **p_boundaries, MxS32 &p_numL)
Gets information about the currently active path and boundaries.
Definition: legoworld.cpp:402
LegoCacheSoundList * m_cacheSoundList
List of cached sounds for faster access during this world's lifetime.
Definition: legoworld.h:342
MxResult PlaceActor(LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale)
Places an actor along a path, from source to destination, using named references and scaling.
Definition: legoworld.cpp:267
LegoHideAnimPresenter * m_hideAnim
Animation presenter for ROI hide (vanish, fade, etc.) sequences.
Definition: legoworld.h:378
MxBool PresentersPending()
Checks if there are any presenters pending to fully enter their tickle (animation) state.
Definition: legoworld.cpp:832
LegoPathControllerList m_pathControllerList
List of all path controllers currently managing pathing in this world.
Definition: legoworld.h:322
MxCoreSet m_set0xd0
Set of currently paused/disconnected objects when world is disabled.
Definition: legoworld.h:363
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
Definition: legoworld.cpp:418
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
Definition: legoworld.cpp:684
MxBool ActorExists(LegoPathActor *p_actor)
Determines if an actor already exists in any controller in this world.
Definition: legoworld.cpp:338
LegoHideAnimPresenter * GetHideAnimPresenter()
Gets the animation presenter responsible for hide animations in this world.
Definition: legoworld.h:307
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
Definition: legoworld.cpp:810
LegoOmni::World GetWorldId()
Gets the world id associated with this world.
Definition: legoworld.h:289
LegoPathBoundary * FindPathBoundary(const char *p_name)
Finds a path boundary in all path controllers by name.
Definition: legoworld.cpp:385
LegoEntityList * GetEntityList()
Returns the current list of entities.
Definition: legoworld.h:283
MxCoreSet m_set0xa8
Set of 'auxiliary' objects, including presenters, that aren't core entity or animation,...
Definition: legoworld.h:352
MxBool IsA(const char *p_name) const override
Runtime type checking; checks class hierarchy.
Definition: legoworld.h:153
void FUN_1001fda0(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers to perform a custom action (possibly hide,...
Definition: legoworld.cpp:354
list< LegoROI * > m_roiList
List of all visible LegoROI objects in the world, used for rendering and selection.
Definition: legoworld.h:368
LegoCameraController * m_cameraController
Camera controller for world's main view.
Definition: legoworld.h:332
MxS16 m_startupTicks
Current world startup tick countdown—controls staged world startup logic.
Definition: legoworld.h:383
LegoWorld()
Constructs a LegoWorld, initializing lists and notifying the notification manager.
Definition: legoworld.cpp:35
const char * ClassName() const override
Returns the class name for runtime type information and debugging.
Definition: legoworld.h:143
MxBool GetUnknown0xd0Empty()
Checks if the 'set0xd0' set is empty.
Definition: legoworld.h:295
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
Definition: legoworld.h:388
StartupTicks
Ticks for world startup sequencing.
Definition: legoworld.h:54
@ e_start
Start tick, world is ready to be started. [AI].
Definition: legoworld.h:55
@ e_two
Countdown tick 2. [AI].
Definition: legoworld.h:57
@ e_four
Countdown tick 4, initial state. [AI].
Definition: legoworld.h:59
@ e_one
Countdown tick 1. [AI].
Definition: legoworld.h:56
@ e_three
Countdown tick 3. [AI].
Definition: legoworld.h:58
void Destroy(MxBool p_fromDestructor) override
Destroys the world and its contents, optionally called from the destructor.
Definition: legoworld.cpp:94
MxBool m_destroyed
Indicates if the world has been destroyed or is pending destruction.
Definition: legoworld.h:347
void FUN_1001fe90(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers for another custom or state change action.
Definition: legoworld.cpp:366
virtual MxBool Escape()
Handles user-initiated "escape" or exit action.
Definition: legoworld.h:131
virtual MxBool VTable0x5c()
Potential "escape" action for world; returns FALSE by default, may be overridden in child worlds.
Definition: legoworld.h:120
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
Definition: legoworld.cpp:573
LegoEntityList * m_entityList
List of all main world entities, such as actors and objects.
Definition: legoworld.h:337
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
Definition: legoworld.cpp:212
virtual LegoCameraController * VTable0x54()
Initializes and returns the camera controller for the world; may create it on-demand.
Definition: legoworld.cpp:233
MxPresenterList m_animPresenters
List of active animation presenters (anims, hide/show, looping, etc.).
Definition: legoworld.h:327
list< LegoROI * > & GetROIList()
Gets the list of all ROIs (Real-time Object Instances) in the world.
Definition: legoworld.h:301
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
Definition: legoworld.cpp:325
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
Definition: legoworld.cpp:58
MxPresenterList m_controlPresenters
List of control presenters (UI, input, cutscene control, etc.).
Definition: legoworld.h:357
void AddPath(LegoPathController *p_controller)
Adds a path controller to the world and calls its initialization with this.
Definition: legoworld.cpp:377
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
Definition: legoworld.h:277
~LegoWorld() override
Cleans up the world, destroying all held entities, presenters, and controllers.
Definition: legoworld.cpp:49
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] List to hold pointers to MxPresenter objects with optional ownership semantics.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
#define override
Definition: compat.h:21
#define FALSE
Definition: d3drmdef.h:27
unsigned char undefined
Definition: decomp.h:26
#define COMPARE_POINTER_TYPE
Definition: legoworld.h:22
set< MxCore *, CoreSetCompare > MxCoreSet
Set of MxCore* pointers with custom comparison for pointer stability and uniqueness.
Definition: legoworld.h:40
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
signed int MxS32
[AI]
Definition: mxtypes.h:38
Comparison functor for MxCore* pointers used by MxCoreSet to ensure a consistent ordering.
Definition: legoworld.h:30
MxS32 operator()(MxCore *const &p_a, MxCore *const &p_b) const
Definition: legoworld.h:31