37 m_startupTicks = e_four;
38 m_cameraController =
NULL;
40 m_cacheSoundList =
NULL;
43 m_worldStarted =
FALSE;
113 while (animPresenterCursor.
First(presenter)) {
114 animPresenterCursor.
Detach();
118 if (presenter->
IsA(
"LegoLocomotionAnimPresenter")) {
135 MxCoreSet::iterator it =
m_set0xa8.begin();
139 if (object->
IsA(
"MxPresenter")) {
155 while (controlPresenterCursor.
First(presenter)) {
156 controlPresenterCursor.
Detach();
174 while (cursor.
First(entity)) {
190 while (cursor.
First(sound)) {
205 if (!p_fromDestructor) {
279 while (cursor.
Next(controller)) {
280 if (controller->
PlaceActor(p_actor, p_name, p_src, p_srcScale, p_dest, p_destScale) ==
SUCCESS) {
294 while (cursor.
Next(controller)) {
314 while (cursor.
Next(controller)) {
315 if (controller->
PlaceActor(p_actor, p_presenter, p_position, p_direction) ==
SUCCESS) {
330 while (cursor.
Next(controller)) {
343 while (cursor.
Next(controller)) {
359 while (cursor.
Next(controller)) {
371 while (cursor.
Next(controller)) {
390 while (cursor.
Next(controller)) {
407 cursor.
Next(controller);
420 if (p_object ==
NULL || p_object->
IsA(
"LegoWorld") || p_object->
IsA(
"LegoWorldPresenter")) {
425 if (p_object->
IsA(
"LegoAnimPresenter")) {
426 if (!strcmpi(((
LegoAnimPresenter*) p_object)->GetAction()->GetObjectName(),
"ConfigAnimation")) {
435 if (p_object->
IsA(
"MxControlPresenter")) {
445 else if (p_object->
IsA(
"MxEntity")) {
455 else if (p_object->
IsA(
"LegoLocomotionAnimPresenter") || p_object->
IsA(
"LegoHideAnimPresenter") || p_object->
IsA(
"LegoLoopingAnimPresenter")) {
466 if (p_object->
IsA(
"LegoHideAnimPresenter")) {
471 else if (p_object->
IsA(
"LegoCacheSound")) {
483 MxCoreSet::iterator it =
m_set0xa8.find(p_object);
486 if (p_object->
IsA(
"MxPresenter")) {
487 assert(
static_cast<MxPresenter*
>(p_object)->GetAction());
498 if (
m_set0xd0.size() != 0 && p_object->
IsA(
"MxPresenter")) {
510 MxCoreSet::iterator it;
512 if (p_object ==
NULL) {
516 if (p_object->
IsA(
"MxControlPresenter")) {
525 else if (p_object->
IsA(
"LegoLocomotionAnimPresenter") || p_object->
IsA(
"LegoHideAnimPresenter") || p_object->
IsA(
"LegoLoopingAnimPresenter")) {
532 if (p_object->
IsA(
"LegoHideAnimPresenter")) {
536 else if (p_object->
IsA(
"MxEntity")) {
537 if (p_object->
IsA(
"LegoPathActor")) {
550 else if (p_object->
IsA(
"LegoCacheSound")) {
575 if (!strcmp(p_class,
"MxControlPresenter")) {
579 while (cursor.
Next(presenter)) {
588 if (!strcmp(p_class,
"MxEntity")) {
592 while (cursor.
Next(entity)) {
598 if (roi && !strcmpi(roi->
GetName(), p_name)) {
606 if (!strcmp(p_class,
"LegoAnimPresenter")) {
610 while (cursor.
Next(presenter)) {
620 if ((*i)->IsA(p_class) && (*i)->IsA(
"MxPresenter")) {
623 if (!strcmp(((
MxPresenter*) (*i))->GetAction()->GetObjectName(), p_name)) {
639 while (entityCursor.
Next(entity)) {
648 while (controlPresenterCursor.
Next(presenter)) {
658 while (animPresenterCursor.
Next(presenter)) {
669 if (core->
IsA(
"MxPresenter")) {
686 MxCoreSet::iterator it;
699 while (cursor.
Next(entity)) {
714 if ((*it)->IsA(
"MxPresenter")) {
717 else if ((*it)->IsA(
"LegoPathController")) {
745 else if (!p_enable &&
m_set0xd0.size() == 0) {
766 while (controlPresenterCursor.
Next(presenter)) {
774 if ((*it)->IsA(
"LegoActionControlPresenter") ||
775 ((*it)->IsA(
"MxPresenter") && ((
MxPresenter*) *it)->IsEnabled())) {
800 while (pathControllerCursor.
Next(controller)) {
837 while (controlPresenterCursor.
Next(presenter)) {
845 while (animPresenterCursor.
Next(presenter)) {
847 if (presenter->
IsA(
"LegoLocomotionAnimPresenter")) {
861 if ((*it)->IsA(
"MxPresenter")) {
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
void Reset(MxBool p_und)
[AI] Resets all internal state; optionally resets animation state too.
void FUN_10061010(MxBool p_und)
[AI] Cancels all camera/transition animations and resets camera after completion.
MxResult LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all world animation and extra info.
void Resume()
[AI] Resumes animation manager from suspension, restoring all previously suspended state.
void Reset()
[AI] Removes all building-state links to world entities and cancels/cleans any scheduled animation en...
void LoadWorldInfo()
[AI] Loads/creates building models for the current world, sets up variants appropriately for current ...
[AI] Cursor/iterator class for traversing a LegoCacheSoundList.
[AI] Specialized pointer list for managing a collection of LegoCacheSound objects,...
void Destroy(LegoCacheSound *&p_sound)
[AI] Destroys (deletes and removes) the specified sound object from all tracking.
Sound cache object managing DirectSound buffers and 3D positioning for preloaded sound data.
Camera controller for 3D scenes, handles interactive camera manipulation and view transformation.
virtual MxResult Create()
Registers the camera controller with input manager and initializes state with current view.
void FUN_10028df0(MxPresenterList *p_presenterList)
[AI] Assigns the active presenter list to this control manager.
[AI] Cursor class for iterating through a LegoEntityList.
[AI] A strongly typed list for holding LegoEntity pointers.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
virtual void Destroy(MxBool p_fromDestructor)
[AI] Cleans up the entity, detaching ROI and releasing references.
MxU8 GetFlags()
[AI] Returns the value of the flag byte. [AI]
@ c_managerOwned
[AI] Indicates this entity is managed/owned by an entity manager [AI]
void ResetROI()
Re-applies the current actor's ROI to the 3D world (remove/add for update). [AI].
[AI] Presenter class responsible for controlling animations that hide or show actors based on animati...
[AI] Specialized presenter class for handling locomotion animation playback and state in the LEGO Isl...
void DecrementUnknown0xd4()
[AI] Decrements the reference/lightweight counter controlling an internal streaming/cleanup state.
undefined2 GetUnknown0xd4()
[AI] Accessor for m_unk0xd4, a lightweight counter used internally to gate certain state transitions.
void SetNavController(LegoNavController *p_navController)
[AI] Sets the navigation controller.
@ e_undefined
[AI] No world specified. [AI]
void SetCurrentWorld(LegoWorld *p_currentWorld)
[AI] Sets the current world pointer for global context.
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
Cursor/iterator for traversing a LegoPathControllerList.
[AI] Manager for controlling actors' movement along predefined geometric paths.
MxBool ActorExists(LegoPathActor *p_actor)
[AI] Checks whether an actor is contained in the controller's actor set.
void FUN_100468f0(LegoAnimPresenter *p_presenter)
[AI] Processes all boundaries except those with bit3 set, invoking FUN_10057fe0 for the provided anim...
MxResult FUN_10046b30(LegoPathBoundary *&p_boundaries, MxS32 &p_numL)
[AI] Provides current array of boundaries and count as output parameters, for external queries.
LegoPathBoundary * GetPathBoundary(const char *p_name)
[AI] Searches for a path boundary by name among owned boundaries.
MxResult RemoveActor(LegoPathActor *p_actor)
[AI] Removes an actor from the controller, detaches it from controlled boundaries,...
MxResult PlaceActor(LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale)
[AI] Places an actor on a boundary at given source/destination edge indices, commonly for track segme...
void Enable(MxBool p_enable)
[AI] Enables or disables the controller's registration with the tickle manager, controlling per-frame...
void FUN_10046bb0(LegoWorld *p_world)
[AI] Assigns the provided world pointer to all struct triggers owned by this path controller.
void FUN_10046930(LegoAnimPresenter *p_presenter)
[AI] Invokes FUN_100586e0 for each boundary, with the provided animation presenter.
void LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all plant objects/entities for the requested world, instantiates requisite ROIs and entiti...
void Reset(LegoOmni::World p_worldId)
[AI] Completely resets (removes) all plant objects for the supplied world.
LegoNavController * GetNavController()
[AI] Accessor for the navigation controller associated with this point-of-view controller.
void OnViewSize(int p_width, int p_height)
[AI] Updates the controller's internal state for a view size change, such as resizing the 3D viewport...
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
void SetEntity(LegoEntity *p_entity)
[AI] Associates a LegoEntity with this ROI (typically called by parent entity/logic).
const LegoChar * GetName() const
[AI] Gets this ROI's name.
LegoCacheSoundManager * GetCacheSoundManager()
[AI] Returns the cache sound manager used to cache and reuse sound effects.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
virtual void ReadyWorld()
Called when the world is ready to be used—typically for custom scene setup after startup.
LegoOmni::World m_worldId
Currently assigned world id, corresponding to an enum in LegoOmni.
MxResult GetCurrPathInfo(LegoPathBoundary **p_boundaries, MxS32 &p_numL)
Gets information about the currently active path and boundaries.
LegoCacheSoundList * m_cacheSoundList
List of cached sounds for faster access during this world's lifetime.
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.
LegoHideAnimPresenter * m_hideAnim
Animation presenter for ROI hide (vanish, fade, etc.) sequences.
MxBool PresentersPending()
Checks if there are any presenters pending to fully enter their tickle (animation) state.
LegoPathControllerList m_pathControllerList
List of all path controllers currently managing pathing in this world.
MxCoreSet m_set0xd0
Set of currently paused/disconnected objects when world is disabled.
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
MxBool ActorExists(LegoPathActor *p_actor)
Determines if an actor already exists in any controller in this world.
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
LegoPathBoundary * FindPathBoundary(const char *p_name)
Finds a path boundary in all path controllers by name.
MxCoreSet m_set0xa8
Set of 'auxiliary' objects, including presenters, that aren't core entity or animation,...
void FUN_1001fda0(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers to perform a custom action (possibly hide,...
list< LegoROI * > m_roiList
List of all visible LegoROI objects in the world, used for rendering and selection.
LegoCameraController * m_cameraController
Camera controller for world's main view.
MxS16 m_startupTicks
Current world startup tick countdown—controls staged world startup logic.
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
@ e_start
Start tick, world is ready to be started. [AI].
@ e_two
Countdown tick 2. [AI].
void Destroy(MxBool p_fromDestructor) override
Destroys the world and its contents, optionally called from the destructor.
MxBool m_destroyed
Indicates if the world has been destroyed or is pending destruction.
void FUN_1001fe90(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers for another custom or state change action.
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
LegoEntityList * m_entityList
List of all main world entities, such as actors and objects.
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
virtual LegoCameraController * VTable0x54()
Initializes and returns the camera controller for the world; may create it on-demand.
MxPresenterList m_animPresenters
List of active animation presenters (anims, hide/show, looping, etc.).
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
MxPresenterList m_controlPresenters
List of control presenters (UI, input, cutscene control, etc.).
void AddPath(LegoPathController *p_controller)
Adds a path controller to the world and calls its initialization with this.
~LegoWorld() override
Cleans up the world, destroying all held entities, presenters, and controllers.
[AI] Atomized (unique) string identifier, managed by reference counting.
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
[AI] Base virtual class for all Mindscape engine (Mx) objects.
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
@ c_world
[AI] Action is described in world-space coordinates [AI]
@ c_enabled
[AI] Action is currently enabled [AI]
const char * GetObjectName() const
[AI] Returns the object name string.
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
MxAtomId & GetAtomId()
Returns a reference to the entity AtomId.
MxS32 GetEntityId()
Returns the current entity ID.
virtual MxResult Create(MxS32 p_entityId, const MxAtomId &p_atomId)
Initializes the entity from a given entity ID and AtomId.
MxBool First(T &p_obj)
[AI]
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
[AI] Cursor/iterator for traversing an MxPresenterList.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
virtual void EndAction()
[AI] Terminates the current action, notifies listeners and resets state.
virtual void Enable(MxBool p_enable)
[AI] Enables or disables this presenter (controls action flags accordingly).
MxBool IsEnabled()
[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).
virtual MxBool HasTickleStatePassed(TickleState p_tickleState)
[AI] Checks if the specified tickle state has ever been passed since last reset.
@ e_ready
[AI] Prepared to start processing an action.
@ e_starting
[AI] In the process of starting playback/presentation.
MxBool IsA(const char *p_name) const override
[AI] Determines if this object is of (or inherits) the specified named class.
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
void Add(ViewROI *p_roi)
[AI] Adds a ViewROI object to the list of managed ROI objects.
void RemoveAll(ViewROI *p_roi)
[AI] Recursively removes all ViewROI objects.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
void FUN_1003e050(LegoAnimPresenter *p_presenter)
[AI] Repositions the camera and updates the view matrix using a LegoAnimPresenter's animation nodes n...
@ e_cursorArrow
[AI] Standard arrow cursor. [AI]
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....
ViewManager * GetViewManager()
[AI] Accessor for the current ViewManager, managing rendering views/cameras. [AI]
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
void SetCurrentWorld(LegoWorld *p_world)
[AI] Sets the current LegoWorld used for all world/scene logic.
LegoNavController * NavController()
[AI] Accessor for the navigation controller, managing player/camera navigation. [AI]
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
void SetIsWorldActive(MxBool p_isWorldActive)
[AI] Toggles whether the world should be considered active (enables/disables camera/user control etc)...
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
@ c_notificationNewPresenter
[AI] Notification about a new Presenter object [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
void FUN_100b7220(MxDSAction *p_action, MxU32 p_newFlags, MxBool p_setFlags)
Recursively sets or clears flags for an MxDSAction and all sub-actions if applicable.