66 while (cursor.
Current(action)) {
68 const char* presenterName;
88 if (presenter->
IsA(
"LegoAnimPresenter") || presenter->
IsA(
"LegoLoopingAnimPresenter")) {
97 m_list.push_back(presenter);
129 if (m_animmanId != 0) {
136 if (m_world !=
NULL) {
158 if (m_presenter !=
NULL) {
183 if (FUN_1004b450()) {
192 if (m_presenter ==
NULL) {
195 else if (
m_list.size() <= 1) {
196 if (
m_list.front() == m_presenter) {
245 char extraCopy[1024];
246 memcpy(extraCopy, extraData, extraLength);
247 extraCopy[extraLength] =
'\0';
252 m_animmanId = atoi(token);
255 if (m_tranInfo !=
NULL) {
265MxBool LegoAnimMMPresenter::FUN_1004b450()
272 if (!FUN_1004b530(time)) {
277 if (!FUN_1004b570(time)) {
282 if (!FUN_1004b580(time)) {
287 if (!FUN_1004b5b0(time)) {
292 if (!FUN_1004b600(time)) {
297 if (!FUN_1004b610(time)) {
302 if (!FUN_1004b6b0(time)) {
318 if (m_presenter !=
NULL) {
320 m_roiMap = m_presenter->
GetROIMap(m_roiMapSize);
362 if (m_roiMap !=
NULL && m_unk0x68 !=
NULL) {
363 for (
MxU32 i = 0; i < m_roiMapSize; i++) {
394 for (MxCompositePresenterList::iterator it =
m_list.begin(); it !=
m_list.end(); it++) {
395 if ((*it)->IsA(
"LegoAnimPresenter") || (*it)->IsA(
"LegoLoopingAnimPresenter")) {
399 (*it)->SetTickleState(
e_ready);
432 if (m_world !=
NULL) {
435 if (m_presenter !=
NULL) {
445 und = m_world->
PlaceActor(actor, m_presenter, position, direction);
472 return m_unk0x58 >=
e_unk6;
481 if (m_presenter !=
NULL) {
485 for (MxCompositePresenterList::iterator it =
m_list.begin(); it !=
m_list.end(); it++) {
486 if (*it != m_presenter) {
494 if (action !=
NULL) {
BOOL Moved(ViewROI &rROI)
[AI] Notifies the manager that the ROI has moved and needs spatial update.
[AI] Composite presenter class that manages a multi-media animation sequence.
void DoneTickle() override
[AI] Tickle callback for the done state.
void FUN_1004b840()
[AI] Helper routine to end all actions except the central one, handle action teardown,...
void EndAction() override
[AI] Ends the composite action, unregisters and resets relevant state.
@ e_unk2
[AI] Step 2 in tickle progression.
@ e_unk5
[AI] Step 5 in tickle progression.
@ e_unk3
[AI] Step 3 in tickle progression.
@ e_unk0
[AI] Initial state for staged tickling.
@ e_unk4
[AI] Step 4 in tickle progression.
@ e_unk6
[AI] Step 6 in tickle progression.
@ e_unk1
[AI] Step 1 in tickle progression.
@ e_unk7
[AI] Final state for staged tickling.
MxBool FUN_1004b8b0()
[AI] Returns a boolean based on TranInfo, typically whether a specific transition flag is set.
~LegoAnimMMPresenter() override
[AI] Destructor.
void StartingTickle() override
[AI] Tickle callback for the starting state.
void ParseExtra() override
[AI] Parses the "Extra" field from the current action to extract TranInfo and animation manager ID fo...
MxBool FUN_1004b830()
[AI] Returns true if the presenter state has reached or surpassed e_unk6.
void VTable0x60(MxPresenter *p_presenter) override
[AI] (Internal use) Handles a state transfer/notification from a child presenter to this composite pr...
void RepeatingTickle() override
[AI] Tickle callback for the repeating state.
MxResult StartAction(MxStreamController *p_controller, MxDSAction *p_action) override
[AI] Starts a composite action, creating subordinate presenters for each child action.
void FUN_1004b8c0()
[AI] Calls the state transition handler, forcing the presenter's tickle progression for special handl...
MxLong Notify(MxParam &p_param) override
[AI] Handles notifications for the presenter.
void StreamingTickle() override
[AI] Tickle callback for the streaming state.
void ReadyTickle() override
[AI] Tickle callback for the ready state.
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
virtual void VTable0xa0(Matrix4 &p_matrix)
[AI] Sets the baseline transform for the animation.
virtual LegoROI ** GetROIMap(MxU32 &p_roiMapSize)
[AI] Returns the mapping array from animation node index to LegoROI*.
MxResult FUN_1006afc0(MxMatrix *&p_matrix, float p_und)
[AI] Fills a matrix array with each node's local-to-world transform after animation advance (for stat...
void FUN_1006c7a0()
[AI] Immediately completes this animation, updates all ROIs to their final pose.
MxResult FUN_1006b140(LegoROI *p_roi)
[AI] Calculates a blended transformation for a target ROI and applies as base transform for this anim...
LegoTranInfo * GetTranInfo(MxU32 p_index)
[AI] Retrieves an active transition info, or NULL if not found.
Notification parameter for signaling the end of an animation in the LEGO Island engine.
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
@ c_initial
[AI] Default state upon creation or reset. [AI]
virtual void VTable0xa8()
[AI] Re-applies transform to ROI, updates camera if needed, and processes per-actor tick actions.
void SetActorState(MxU32 p_actorState)
[AI] Sets the navigation/path state of the actor.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Lego3DManager * Get3DManager()
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view con...
LegoROI * GetViewROI()
[AI] Returns the viewpoint ROI for the current view/camera.
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
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.
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
void EndAction() override
[AI] Ends the composite action, terminating all child presenters and clearing action lists....
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 ...
MxLong Notify(MxParam &p_param) override
[AI] Notifies the composite presenter of a particular event (such as end of sub-action or notificatio...
[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...
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
virtual void SetUnknown90(MxLong p_unk0x90)
[AI] Set unknown value at offset 0x90, used as baseline in GetElapsedTime.
void SetOrigin(MxCore *p_origin)
[AI] Sets the origin core pointer for this action, if spatially transforming/localizing this action.
void SetFlags(MxU32 p_flags)
[AI] Sets the flag bitmask controlling action logic (enabled, looping, etc).
@ c_looping
[AI] Action or media should repeat in a loop [AI]
@ c_bit3
[AI] Unknown - possibly reserved [AI]
[AI] Represents a container for multiple MxDSAction objects, facilitating the grouping and management...
MxBool Current(T &p_obj)
[AI]
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
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 ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
MxCore * GetSender() const
[AI] Retrieves the sender pointer associated with this notification.
[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.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
virtual void SetTickleState(TickleState p_tickleState)
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
virtual void Enable(MxBool p_enable)
[AI] Enables or disables this presenter (controls action flags accordingly).
virtual MxResult StartAction(MxStreamController *, MxDSAction *)
[AI] Initiates presenter for a new action, setting up context and state.
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
MxS32 GetCurrentTickleState() const
[AI] Returns the current tickle state.
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
@ e_done
[AI] Completed processing the current action.
@ e_idle
[AI] Not processing an action.
@ e_ready
[AI] Prepared to start processing an action.
@ e_freezing
[AI] Temporarily suspending updates or playback.
@ e_starting
[AI] In the process of starting playback/presentation.
@ e_streaming
[AI] Streaming or rendering actively.
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
MxCompositePresenter * m_compositePresenter
[AI] Owner composite presenter, if any.
MxBool IsA(const char *p_name) const override
[AI] Determines if this object is of (or inherits) the specified named class.
virtual MxResult AddToManager()
[AI] Optional registration with a manager (such as TickleManager); by default does nothing.
void SetCompositePresenter(MxCompositePresenter *p_compositePresenter)
[AI] Sets the composite presenter to notify/join on completion.
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
void FUN_100b98f0(MxDSAction *p_action)
Internal: Delegate stream operation on MxDSAction to a DiskStreamController if present.
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
const float * GetWorldPosition() const
Returns a pointer to the world position from the transformation matrix (translation row).
const float * GetWorldDirection() const
Returns a pointer to the world direction vector (forward axis) from the transformation matrix.
void WrappedSetLocalTransform(const Matrix4 &p_transform)
Wraps SetLocalTransform, for possible override or interface uniformity.
#define DECOMP_SIZE_ASSERT(T, S)
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
const char * g_strANIMMAN_ID
[AI] Used to reference the animation manager identifier during entity or animation handling.
#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.
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....
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
MxTimer * Timer()
[AI] Returns the global simulation timer.
MxStreamer * Streamer()
[AI] Returns the global streamer used for all chunked media streaming (SI file, audio,...
MxObjectFactory * ObjectFactory()
[AI] Returns the factory for creating core engine objects from atom/type ids.
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
@ c_notificationEndAnim
[AI] End of an animation [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
const char * PresenterNameDispatch(const MxDSAction &)
[AI] Provides a mapping from action object/type to the correct presenter handler class name based on ...
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
MxBool m_unk0x14
[AI] Boolean flag for an unknown state, frequently used in transformation validity or activation gati...
LegoROI * m_unk0x08
[AI] [AI_SUGGESTED_NAME: targetROI] Pointer to the LEGO ROI (object in world) this transformation app...
MxBool m_unk0x15
[AI] Boolean flag set TRUE on construction, usage context required. Could indicate active/valid statu...
MxMatrix m_unk0x2c
[AI] Current transformation matrix for this entry; reset to identity at construction and modified by ...
MxLong * m_unk0x20
[AI] [AI_SUGGESTED_NAME: animationFramePtr] Pointer to a long integer, possibly for tracking current ...
MxPresenter ** m_unk0x1c
[AI] [AI_SUGGESTED_NAME: presenterList] Pointer to an array of presenter objects. Allows for chained/...
LegoAnimMMPresenter * m_presenter
[AI] Pointer to a specific animation presenter managing this transform's animation (controls playback...
MxMatrix * m_unk0x0c
[AI] [AI_SUGGESTED_NAME: overrideMatrix] Optional pointer to a dynamically allocated matrix for custo...
MxU8 m_unk0x10
[AI] Unknown; likely used for frame counters, step markers, or status flags in animation/transformati...
MxS16 m_location
[AI] Location index within a parent object, animation group, or part-based system....
MxBool m_unk0x28
[AI] Another Boolean flag; TRUE by default. Likely used as part of a multi-flag state or for controll...
MxBool m_unk0x29
[AI] Another Boolean flag; TRUE by default. Possibly for progression or sequencing within animation h...