Isle
Loading...
Searching...
No Matches
LegoAnimPresenter Class Reference

[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution, ROI mapping, and direct control over animation tick cycle. More...

#include <legoanimpresenter.h>

Inheritance diagram for LegoAnimPresenter:
Collaboration diagram for LegoAnimPresenter:

Public Types

enum  { c_hideOnStop = 0x01 , c_mustSucceed = 0x02 }
 [AI] Animation presenter flags More...
 
- Public Types inherited from MxPresenter
enum  TickleState {
  e_idle = 0 , e_ready , e_starting , e_streaming ,
  e_repeating , e_freezing , e_done
}
 [AI] Represents the state of the presenter's tickle (update) lifecycle. More...
 

Public Member Functions

 LegoAnimPresenter ()
 [AI] Constructor for LegoAnimPresenter. More...
 
 ~LegoAnimPresenter () override
 [AI] Destructor for LegoAnimPresenter. More...
 
const char * ClassName () const override
 [AI] RTTI name for the presenter ("LegoAnimPresenter"), used for string-based identification. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Checks if this or a parent class matches the given type name for RTTI. More...
 
void ReadyTickle () override
 [AI] Called when the presenter is in the "Ready" tickle state. More...
 
void StartingTickle () override
 [AI] Called at the "Starting" tickle state. More...
 
void StreamingTickle () override
 [AI] Tickle function during streaming (active animation). More...
 
void DoneTickle () override
 [AI] Called when animation streaming completes; triggers notification and wraps up state. More...
 
void ParseExtra () override
 [AI] Extra data parser for animation presenter. More...
 
MxResult AddToManager () override
 [AI] Adds this presenter instance to the relevant presenter/notification manager. More...
 
void Destroy () override
 [AI] Releases all internal resources, actors, maps, and presenter state. More...
 
MxResult StartAction (MxStreamController *p_controller, MxDSAction *p_action) override
 [AI] Begin playback action using a stream and a given action descriptor. More...
 
void EndAction () override
 [AI] Completes playback action, triggers world notification and resets/hides all animated actors depending on flags. More...
 
void PutFrame () override
 [AI] Called once per frame to push updated animation information (transform, position, etc.) to the ROIs. More...
 
virtual MxResult CreateAnim (MxStreamChunk *p_chunk)
 [AI] Creates/loads the LegoAnim resource instance from a stream chunk buffer. More...
 
virtual void VTable0x8c ()
 [AI] Virtual callback for future expansion. More...
 
virtual void VTable0x90 ()
 [AI] Virtual callback for future expansion. More...
 
virtual MxU32 VTable0x94 (Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3)
 [AI] Tests if a swept segment (defined by v1, v2, f1, f2) collides any of this presenter's animated ROIs. More...
 
virtual MxResult VTable0x98 (LegoPathBoundary *p_boundary)
 [AI] Adds all actor ROIs, associated with this animation, to the provided path boundary for grouping or path following. More...
 
virtual LegoROI ** GetROIMap (MxU32 &p_roiMapSize)
 [AI] Returns the mapping array from animation node index to LegoROI*. More...
 
virtual void VTable0xa0 (Matrix4 &p_matrix)
 [AI] Sets the baseline transform for the animation. More...
 
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 state change / blending). More...
 
MxResult FUN_1006b140 (LegoROI *p_roi)
 [AI] Calculates a blended transformation for a target ROI and applies as base transform for this animation. More...
 
void FUN_1006c7a0 ()
 [AI] Immediately completes this animation, updates all ROIs to their final pose. More...
 
const char * GetActionObjectName ()
 [AI] Gets the name of the object associated with the current animation action. More...
 
void SetCurrentWorld (LegoWorld *p_currentWorld)
 [AI] Sets the world used by this presenter for actor placement and notification. More...
 
void SetUnknown0x0cTo1 ()
 [AI] Sets the value of internal flag m_unk0x9c to 1. More...
 
void SetUnknown0xa0 (Matrix4 *p_unk0xa0)
 [AI] Sets a pointer to the baseline animation transform. More...
 
LegoAnimGetAnimation ()
 [AI] Returns the current animation resource in use. More...
 
- Public Member Functions inherited from MxVideoPresenter
 MxVideoPresenter ()
 Constructs a new MxVideoPresenter and initializes internal state. More...
 
virtual void LoadHeader (MxStreamChunk *p_chunk)
 Loads and processes header information from a video stream chunk. More...
 
virtual void CreateBitmap ()
 Allocates and sets up the display bitmap for video frame data. More...
 
virtual void NextFrame ()
 Advances video playback to the next frame, handling decoding and playback progression. More...
 
virtual void LoadFrame (MxStreamChunk *p_chunk)
 Loads and processes frame data from a video stream chunk. More...
 
virtual void PutFrame ()
 Presents the current frame using the chosen output mechanism (e.g., blitting to screen). More...
 
virtual void RealizePalette ()
 Loads or establishes the palette for display from the current video format or media. More...
 
virtual undefined VTable0x74 ()
 Unknown/potentially format-specific method (VTable0x74). More...
 
 ~MxVideoPresenter () override
 Destroys the MxVideoPresenter, releasing owned resources and unregistering from the manager. More...
 
void Destroy () override
 Destroys internal resources for the presenter. More...
 
virtual LPDIRECTDRAWSURFACE VTable0x78 ()
 Retrieves the DirectDraw surface used for hardware-accelerated rendering. More...
 
virtual MxBool VTable0x7c ()
 Checks if this presenter has either a video frame bitmap or alpha mask available. More...
 
virtual MxS32 GetWidth ()
 Returns the width of the current bitmap or alpha mask in pixels. More...
 
virtual MxS32 GetHeight ()
 Returns the height of the current bitmap or alpha mask in pixels. More...
 
const char * ClassName () const override
 Returns the run-time class name of this presenter instance. More...
 
MxBool IsA (const char *p_name) const override
 Determines if this object is or derives from a class with the given name. More...
 
void ReadyTickle () override
 Advance logic for the "ready" tickle state. More...
 
void StartingTickle () override
 Advance logic for the "starting" tickle state (frame setup). More...
 
void StreamingTickle () override
 Advance logic for the "streaming" tickle state (typical video playback). More...
 
void RepeatingTickle () override
 Advance logic for the "repeating" tickle state (media looping). More...
 
void FreezingTickle () override
 Advance logic for the "freezing" tickle state (sustain after playback). More...
 
MxResult AddToManager () override
 Adds this presenter to the global video manager. More...
 
void EndAction () override
 Signals the end of the current playback action. More...
 
MxResult PutData () override
 Writes the frame to the display device if appropriate. More...
 
MxBool IsHit (MxS32 p_x, MxS32 p_y) override
 Determines if a point is inside the non-transparent region of frame/alpha. More...
 
MxS32 PrepareRects (RECT &p_rectDest, RECT &p_rectSrc)
 Utility function to adjust source/dest rectangles to stay within allowed bounds. More...
 
MxBitmapGetBitmap ()
 Returns the frame bitmap currently used for this presenter. More...
 
AlphaMaskGetAlphaMask ()
 Returns this presenter's alpha mask for hit testing. More...
 
MxU8GetBitmapStart (MxS32 p_left, MxS32 p_top)
 Provides a pointer to the start of frame bitmap data at a given coordinate. More...
 
void SetBit0 (BOOL p_e)
 Sets internal miscellaneous state flags. More...
 
void SetBit1 (BOOL p_e)
 
void SetBit2 (BOOL p_e)
 
void SetBit3 (BOOL p_e)
 
void SetBit4 (BOOL p_e)
 
BYTE GetBit0 ()
 Gets internal miscellaneous state flags (bits 0-4). More...
 
BYTE GetBit1 ()
 
BYTE GetBit2 ()
 
BYTE GetBit3 ()
 
BYTE GetBit4 ()
 
- Public Member Functions inherited from MxMediaPresenter
 MxMediaPresenter ()
 [AI] Constructs the presenter, initializing all member variables. More...
 
 ~MxMediaPresenter () override
 [AI] Destructor; cleans up and optionally destroys all internal resources as well as the MxDSSubscriber and chunk list/cursor. More...
 
void Destroy () override
 [AI] Cleans up internal resources and resets the presenter to an uninitialized state. More...
 
MxResult Tickle () override
 [AI] Advances the presenter's state and media stream, if any, by tickling (i.e., updating) components. More...
 
const char * ClassName () const override
 [AI] Returns the class name for this presenter (see HandlerClassName()). More...
 
MxBool IsA (const char *p_name) const override
 [AI] Returns TRUE if the provided class name matches this class or any of its parents. More...
 
void StreamingTickle () override
 [AI] Per-frame update when streaming the media stream. More...
 
void RepeatingTickle () override
 [AI] Per-frame update while looping/repeating over known chunks. More...
 
void DoneTickle () override
 [AI] Per-frame update for the "done" state; transitions this presenter to idle and ends the action. More...
 
MxResult StartAction (MxStreamController *, MxDSAction *) override
 [AI] Begins a new media playback action, wiring up the stream and chunk lists as needed. More...
 
void EndAction () override
 [AI] Ends the media playback action, releasing all resources, notifying listeners if necessary. More...
 
void Enable (MxBool p_enable) override
 [AI] Enables or disables media stream playback and transitions state as needed. More...
 
virtual void LoopChunk (MxStreamChunk *p_chunk)
 [AI] Adds a chunk to the looping chunk list, making it available for repeated playback. More...
 
MxStreamChunkCurrentChunk ()
 [AI] Returns a pointer to the current data chunk at the head of the stream, without consuming it. More...
 
MxStreamChunkNextChunk ()
 [AI] Returns the next data chunk in the stream, removing it from the stream queue. More...
 
- Public Member Functions inherited from MxPresenter
 MxPresenter ()
 [AI] Constructor. Initializes internal tickle state and other members. More...
 
MxResult Tickle () override
 [AI] Main tickle handler, called periodically to progress presenter's internal state. More...
 
virtual void VTable0x14 ()
 [AI] Reserved for future or specialized use in derived classes. More...
 
virtual void ReadyTickle ()
 [AI] Handles the transition and setup for the Ready state. Parses extra action data and advances state. More...
 
virtual void StartingTickle ()
 [AI] Handles actions required when first starting presentation. Advances to streaming state. More...
 
virtual void StreamingTickle ()
 [AI] Handles periodic updates during the streaming/presentation stage. Advances to repeating state. More...
 
virtual void RepeatingTickle ()
 [AI] Handles updates when in a repeating (looping) stage. Advances to freezing state. More...
 
virtual void FreezingTickle ()
 [AI] Handles updates during the freezing/suspended state. Advances to done state. More...
 
 ~MxPresenter () override
 [AI] Destructor, cleans up resources (base class: does nothing beyond Init). More...
 
virtual MxResult AddToManager ()
 [AI] Optional registration with a manager (such as TickleManager); by default does nothing. More...
 
virtual void Destroy ()
 [AI] Resets presenter state or cleans up resources after completion/removal. More...
 
virtual MxResult StartAction (MxStreamController *, MxDSAction *)
 [AI] Initiates presenter for a new action, setting up context and state. More...
 
virtual void EndAction ()
 [AI] Terminates the current action, notifies listeners and resets state. More...
 
virtual void SetTickleState (TickleState p_tickleState)
 [AI] Forces the tickle state, advancing to the requested lifecycle stage. More...
 
virtual MxBool HasTickleStatePassed (TickleState p_tickleState)
 [AI] Checks if the specified tickle state has ever been passed since last reset. More...
 
virtual MxResult PutData ()
 [AI] Allows the presenter to submit pending results or output to the engine. More...
 
virtual MxBool IsHit (MxS32 p_x, MxS32 p_y)
 [AI] Returns TRUE if the given (x, y) falls within hit-test bounds for the presenter (e.g. More...
 
virtual void Enable (MxBool p_enable)
 [AI] Enables or disables this presenter (controls action flags accordingly). More...
 
const char * ClassName () const override
 [AI] Returns the run-time class name for this presenter. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Determines if this object is of (or inherits) the specified named class. More...
 
MxEntityCreateEntity (const char *p_defaultName)
 [AI] Creates an entity based on action 'extra' data, or uses the provided default name. More...
 
void SendToCompositePresenter (MxOmni *p_omni)
 [AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group. More...
 
MxBool IsEnabled ()
 [AI] Returns whether this presenter is logically enabled (based on the associated action's flags). More...
 
MxS32 GetCurrentTickleState () const
 [AI] Returns the current tickle state. More...
 
MxPoint32 GetLocation () const
 [AI] Returns the presenter's screen location (in pixels). More...
 
MxS32 GetX () const
 [AI] Returns the X coordinate of screen location. More...
 
MxS32 GetY () const
 [AI] Returns the Y coordinate of screen location. More...
 
MxS32 GetDisplayZ () const
 [AI] Returns the display Z (depth) order. More...
 
MxDSActionGetAction () const
 [AI] Returns the current action being presented. More...
 
void SetAction (MxDSAction *p_action)
 [AI] Sets the action associated with this presenter. More...
 
void SetCompositePresenter (MxCompositePresenter *p_compositePresenter)
 [AI] Sets the composite presenter to notify/join on completion. More...
 
void SetDisplayZ (MxS32 p_displayZ)
 [AI] Sets the display Z (depth) order for the presenter. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Static Public Member Functions

static const char * HandlerClassName ()
 [AI] Returns the class name for this presenter ("LegoAnimPresenter"). More...
 
- Static Public Member Functions inherited from MxVideoPresenter
static const char * HandlerClassName ()
 Returns the class name string for this presenter type. More...
 
- Static Public Member Functions inherited from MxMediaPresenter
static const char * HandlerClassName ()
 [AI] Gets the class name string for handler dispatch and RTTI emulation. More...
 
- Static Public Member Functions inherited from MxPresenter
static const char * HandlerClassName ()
 [AI] Returns the handler class name for identification and reflection purposes. More...
 

Public Attributes

float m_unk0xa4
 [AI] Animation touch radius for path boundary checks and state (set from resource). More...
 
Mx3DPointFloat m_unk0xa8
 [AI] 3D float property, used for animation base position offset. More...
 

Protected Member Functions

void Init ()
 [AI] Allocates and resets all internal presenter state. More...
 
void Destroy (MxBool p_fromDestructor)
 [AI] Releases all dynamic memory, unbinds actors from animation, and resets references. More...
 
LegoCharFUN_10069150 (const LegoChar *p_und1)
 [AI] [Internal] String construction utility used in actor/ROI naming substitution. More...
 
void FUN_100692b0 ()
 [AI] Populates m_unk0x74 with all relevant ROIs/actors for this animation by iterating actors in the animation resource. More...
 
void FUN_100695c0 ()
 [AI] Scans the world view compound objects to find and collect relevant ROIs for animation, populating m_unk0x70. More...
 
LegoCharFUN_100697c0 (const LegoChar *p_und1, const LegoChar *p_und2)
 [AI] Returns a composed name string for combining variable substitution and direct actor references for name lookup. More...
 
LegoBool FUN_100698b0 (const CompoundObject &p_rois, const LegoChar *p_und2)
 [AI] Locates (and adds to m_unk0x70) an ROI in a compound object by substituted name, matching either direct or indirect name reference. More...
 
LegoROIFUN_100699e0 (const LegoChar *p_und)
 [AI] Looks up an ROI in m_unk0x70 by substituted name. More...
 
void FUN_10069b10 ()
 [AI] Builds mapping from animation node data names to ROIs, fills m_roiMap and m_roiMapSize. More...
 
void FUN_1006a3c0 (LegoAnimStructMap &p_map, LegoTreeNode *p_node, LegoROI *p_roi)
 [AI] Recursive helper for building ROI map: walks animation node tree, matching names to ROIs at each node level. More...
 
void FUN_1006a4f0 (LegoAnimStructMap &p_map, LegoAnimNodeData *p_data, const LegoChar *p_und, LegoROI *p_roi)
 [AI] Helper to insert an animation node's data into the map (adding new struct if not already inserted). More...
 
void FUN_1006aa60 ()
 [AI] Releases all actors in m_unk0x74 via CharacterManager, respecting state flag m_unk0x96. More...
 
void FUN_1006ab70 ()
 [AI] Invokes end-of-animation logic via AnimationManager, depending on mode flag m_unk0x96. More...
 
LegoBool FUN_1006aba0 ()
 [AI] Returns TRUE if every animation actor/ROI node is bound successfully. More...
 
MxBool FUN_1006abb0 (LegoTreeNode *p_node, LegoROI *p_roi)
 [AI] Recursively validates correct ROI matching/binding in animation tree (helper for FUN_1006aba0). More...
 
void SubstituteVariables ()
 [AI] Applies all queued variable substitutions in the animation resource by setting corresponding VariableTable entries. More...
 
void FUN_1006b900 (LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
 [AI] Steps animation nodes to 'p_time' using transform 'p_matrix', using fast path for tree traversal. More...
 
void FUN_1006b9a0 (LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
 [AI] Like FUN_1006b900, but also processes associated camera animation if present. More...
 
void FUN_1006c8a0 (MxBool p_bool)
 [AI] Enables or disables internal state (LegoEntity c_altBit1) on all animated entities. More...
 
- Protected Member Functions inherited from MxVideoPresenter
void Destroy (MxBool p_fromDestructor)
 Releases resources and unregisters presenter from the video manager. More...
 
- Protected Member Functions inherited from MxMediaPresenter
void Init ()
 [AI] Initializes all member variables to a known default state (NULL pointers, etc). More...
 
void Destroy (MxBool p_fromDestructor)
 [AI] Frees all managed resources, owned memory and pointers, optionally preventing destruction of the base class. More...
 
- Protected Member Functions inherited from MxPresenter
virtual void DoneTickle ()
 [AI] Handles any post-completion logic, resetting to idle state. More...
 
virtual void ParseExtra ()
 [AI] Parses additional data from the associated action for configuration or world interaction. More...
 
void ProgressTickleState (TickleState p_tickleState)
 [AI] Helper for advancing the presenter's tickle state and updating transition history. More...
 
void Init ()
 [AI] Initializes object state to post-construction defaults. More...
 

Protected Attributes

LegoAnimm_anim
 [AI] Animation resource currently being played back. More...
 
LegoROI ** m_roiMap
 [AI] Lookup array to map animation node indices to scene ROIs (1-based index). More...
 
MxU32 m_roiMapSize
 [AI] Number of valid entries in m_roiMap (excluding 0th index). More...
 
LegoROIListm_unk0x70
 [AI] List of ROIs used during preprocessing, actor matching, or variable substitution (purpose varies). More...
 
LegoROIListm_unk0x74
 [AI] List of actors/ROIs created or acquired for this animation instance. More...
 
Matrix4m_unk0x78
 [AI] Pointer to root/offset MxMatrix used for transform computations. More...
 
MxU32 m_flags
 [AI] Animation presenter flags (hide-on-stop, must-succeed, etc). More...
 
LegoWorldm_currentWorld
 [AI] Reference to the world in which this presenter is currently placed/active. More...
 
MxAtomId m_worldAtom
 [AI] String identifier for the target world (if set in animation resource via extra data). More...
 
MxS32 m_worldId
 [AI] Numeric world ID for world selection/lookup. More...
 
LegoROI ** m_unk0x8c
 [AI] Lookup array for secondary ROI objects (used for e.g. More...
 
char ** m_unk0x90
 [AI] Array of char* names used for selecting camera attached ROIs (from ptatcam extra parameter). More...
 
MxU8 m_unk0x94
 [AI] Count of valid camera attached ROI names in m_unk0x90 / m_unk0x8c. More...
 
MxBool m_unk0x95
 [AI] Boolean: indicates streaming/animation is finished and presenter should progress to Done state. More...
 
MxBool m_unk0x96
 [AI] Boolean/mode: influences actor release vs animation manager cleanup selection (see FUN_1006ab70). More...
 
undefined m_unk0x97
 [AI] Unknown/unused byte, for possible explicit alignment or hidden flag. More...
 
LegoAnimSubstMapm_substMap
 [AI] Table of macro/variable substitutions to apply before animation begins (from resource "subst" field). More...
 
MxS16 m_unk0x9c
 [AI] Int16 state flag, set via SetUnknown0x0cTo1(). More...
 
Matrix4m_unk0xa0
 [AI] Optional pointer to a matrix storing a blended/baseline local-to-world transform. More...
 
- Protected Attributes inherited from MxVideoPresenter
MxBitmapm_frameBitmap
 Bitmap for current video frame. [AI]. More...
 
AlphaMaskm_alpha
 Alpha mask for hit testing. May be null. [AI]. More...
 
LPDIRECTDRAWSURFACE m_unk0x58
 DirectDraw surface for hardware video rendering. [AI]. More...
 
MxS16 m_unk0x5c
 Loop/advance/frame decode counter. [AI]. More...
 
FlagBitfield m_flags
 Miscellaneous flags for object and UI state. [AI]. More...
 
MxLong m_unk0x60
 Last freeze time/start of sustain interval. [AI]. More...
 
- Protected Attributes inherited from MxMediaPresenter
MxDSSubscriberm_subscriber
 [AI] Subscriber that provides the stream data (e.g., audio/video chunks) for this presenter. More...
 
MxStreamChunkListm_loopingChunks
 [AI] Linked list of all chunks available for looping/repeating playback. More...
 
MxStreamChunkListCursorm_loopingChunkCursor
 [AI] Cursor used to iterate through the loopingChunk list during repeat mode. More...
 
MxStreamChunkm_currentChunk
 [AI] Currently active data chunk for playback or processing. More...
 
- Protected Attributes inherited from MxPresenter
TickleState m_currentTickleState
 [AI] Current state in the tickle lifecycle. More...
 
MxU32 m_previousTickleStates
 [AI] Bitfield representing all tickle states that have already occurred during this lifetime. More...
 
MxPoint32 m_location
 [AI] 2D display location for the presenter. More...
 
MxS32 m_displayZ
 [AI] Z-order value for display stacking. More...
 
MxDSActionm_action
 [AI] The associated action currently being presented by this presenter. More...
 
MxCriticalSection m_criticalSection
 [AI] Thread synchronization for presenter state and data. More...
 
MxCompositePresenterm_compositePresenter
 [AI] Owner composite presenter, if any. More...
 

Detailed Description

[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution, ROI mapping, and direct control over animation tick cycle.

[AI] The LegoAnimPresenter class is a specialized presenter for animated sequences in LEGO Island. It extends MxVideoPresenter and supports advanced operations including variable substitution, actor/ROI mapping, direct control of streaming and tickling, as well as integration with LegoWorld and other engine modules.

This presenter is responsible for:

  • Resource loading and parsing (including variable/macro substition).
  • Proper mapping of animation nodes to scene ROIs.
  • Applying transformations, updating positions/orientation, controlling visibility, etc.
  • Handling specialized callbacks, tickle state transitions (Ready, Starting, Streaming, etc.) and variable overrides.
  • Integrating with composite presenters, variable tables, path boundaries, and world notification system.

State and resource management are handled using a combination of protected helper functions and public tickle hooks.

Size: 0xbc bytes. Part of the LEGO1 main engine codebase.

Definition at line 94 of file legoanimpresenter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

[AI] Animation presenter flags

[AI] c_hideOnStop: Hides animated ROIs when playback stops. c_mustSucceed: Animation must successfully bind/match all targets before starting.

Enumerator
c_hideOnStop 

Hide animated objects after stopping [AI].

c_mustSucceed 

Require all animation targets be satisfied [AI].

Definition at line 102 of file legoanimpresenter.h.

Constructor & Destructor Documentation

◆ LegoAnimPresenter()

LegoAnimPresenter::LegoAnimPresenter ( )

[AI] Constructor for LegoAnimPresenter.

Initializes all internal structures and states.

Definition at line 33 of file legoanimpresenter.cpp.

◆ ~LegoAnimPresenter()

LegoAnimPresenter::~LegoAnimPresenter ( )
override

[AI] Destructor for LegoAnimPresenter.

Finalizes and releases all held resources, actors, and variables.

Definition at line 39 of file legoanimpresenter.cpp.

Member Function Documentation

◆ AddToManager()

MxResult LegoAnimPresenter::AddToManager ( )
overridevirtual

[AI] Adds this presenter instance to the relevant presenter/notification manager.

Returns
Result indicating success or failure. [AI]

Reimplemented from MxPresenter.

Reimplemented in LegoHideAnimPresenter, and LegoLocomotionAnimPresenter.

Definition at line 867 of file legoanimpresenter.cpp.

◆ ClassName()

const char * LegoAnimPresenter::ClassName ( ) const
overridevirtual

[AI] RTTI name for the presenter ("LegoAnimPresenter"), used for string-based identification.

Returns
Class name string [AI]

Reimplemented from MxCore.

Reimplemented in LegoCarBuildAnimPresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, and LegoLoopingAnimPresenter.

◆ CreateAnim()

MxResult LegoAnimPresenter::CreateAnim ( MxStreamChunk p_chunk)
virtual

[AI] Creates/loads the LegoAnim resource instance from a stream chunk buffer.

Parameters
p_chunkAnimation data chunk (streamed or loaded). [AI]
Returns
Result indicating success of the parsing/loading operation. [AI]

Reimplemented in LegoLocomotionAnimPresenter.

Definition at line 137 of file legoanimpresenter.cpp.

◆ Destroy() [1/2]

void LegoAnimPresenter::Destroy ( )
overridevirtual

[AI] Releases all internal resources, actors, maps, and presenter state.

Reimplemented from MxPresenter.

Reimplemented in LegoHideAnimPresenter, and LegoLocomotionAnimPresenter.

Definition at line 873 of file legoanimpresenter.cpp.

◆ Destroy() [2/2]

void LegoAnimPresenter::Destroy ( MxBool  p_fromDestructor)
protected

[AI] Releases all dynamic memory, unbinds actors from animation, and resets references.

Parameters
p_fromDestructorTrue if called by destructor, false for explicit destroy [AI]

Definition at line 71 of file legoanimpresenter.cpp.

◆ DoneTickle()

void LegoAnimPresenter::DoneTickle ( )
overridevirtual

[AI] Called when animation streaming completes; triggers notification and wraps up state.

Reimplemented from MxPresenter.

Definition at line 861 of file legoanimpresenter.cpp.

◆ EndAction()

void LegoAnimPresenter::EndAction ( )
overridevirtual

[AI] Completes playback action, triggers world notification and resets/hides all animated actors depending on flags.

Reimplemented from MxPresenter.

Reimplemented in LegoCarBuildAnimPresenter, LegoHideAnimPresenter, and LegoLocomotionAnimPresenter.

Definition at line 1066 of file legoanimpresenter.cpp.

◆ FUN_10069150()

LegoChar * LegoAnimPresenter::FUN_10069150 ( const LegoChar p_und1)
protected

[AI] [Internal] String construction utility used in actor/ROI naming substitution.

Used when an actor string begins with a marker.

Parameters
p_und1Source actor string, possibly with marker. [AI]
Returns
Newly allocated string with substituted or resolved value [AI]

Definition at line 188 of file legoanimpresenter.cpp.

◆ FUN_100692b0()

void LegoAnimPresenter::FUN_100692b0 ( )
protected

[AI] Populates m_unk0x74 with all relevant ROIs/actors for this animation by iterating actors in the animation resource.

Definition at line 215 of file legoanimpresenter.cpp.

◆ FUN_100695c0()

void LegoAnimPresenter::FUN_100695c0 ( )
protected

[AI] Scans the world view compound objects to find and collect relevant ROIs for animation, populating m_unk0x70.

Definition at line 293 of file legoanimpresenter.cpp.

◆ FUN_100697c0()

LegoChar * LegoAnimPresenter::FUN_100697c0 ( const LegoChar p_und1,
const LegoChar p_und2 
)
protected

[AI] Returns a composed name string for combining variable substitution and direct actor references for name lookup.

Parameters
p_und1Source string [AI]
p_und2Optional prefix, NULL if unused [AI]
Returns
Newly allocated string encoding full actor/ROI name [AI]

Definition at line 327 of file legoanimpresenter.cpp.

◆ FUN_100698b0()

LegoBool LegoAnimPresenter::FUN_100698b0 ( const CompoundObject p_rois,
const LegoChar p_und2 
)
protected

[AI] Locates (and adds to m_unk0x70) an ROI in a compound object by substituted name, matching either direct or indirect name reference.

Parameters
p_roisCompoundObject: the object list to search [AI]
p_und2Name string for matching [AI]
Returns
TRUE if found/matched, FALSE otherwise [AI]

Definition at line 354 of file legoanimpresenter.cpp.

◆ FUN_100699e0()

LegoROI * LegoAnimPresenter::FUN_100699e0 ( const LegoChar p_und)
protected

[AI] Looks up an ROI in m_unk0x70 by substituted name.

Parameters
p_undSubstituted name string [AI]
Returns
ROI pointer if found, NULL otherwise [AI]

Definition at line 385 of file legoanimpresenter.cpp.

◆ FUN_10069b10()

void LegoAnimPresenter::FUN_10069b10 ( )
protected

[AI] Builds mapping from animation node data names to ROIs, fills m_roiMap and m_roiMapSize.

Definition at line 405 of file legoanimpresenter.cpp.

◆ FUN_1006a3c0()

void LegoAnimPresenter::FUN_1006a3c0 ( LegoAnimStructMap p_map,
LegoTreeNode p_node,
LegoROI p_roi 
)
protected

[AI] Recursive helper for building ROI map: walks animation node tree, matching names to ROIs at each node level.

Parameters
p_mapOutput: current name-to-struct map [AI]
p_nodeCurrent tree node [AI]
p_roiCurrent ROI being matched [AI]

Definition at line 446 of file legoanimpresenter.cpp.

◆ FUN_1006a4f0()

void LegoAnimPresenter::FUN_1006a4f0 ( LegoAnimStructMap p_map,
LegoAnimNodeData p_data,
const LegoChar p_und,
LegoROI p_roi 
)
protected

[AI] Helper to insert an animation node's data into the map (adding new struct if not already inserted).

Parameters
p_mapOutput: current name-to-struct map [AI]
p_dataAnimation node data for current entry [AI]
p_undSubstituted name string [AI]
p_roiROI being matched [AI]

Definition at line 498 of file legoanimpresenter.cpp.

◆ FUN_1006aa60()

void LegoAnimPresenter::FUN_1006aa60 ( )
protected

[AI] Releases all actors in m_unk0x74 via CharacterManager, respecting state flag m_unk0x96.

Definition at line 527 of file legoanimpresenter.cpp.

◆ FUN_1006ab70()

void LegoAnimPresenter::FUN_1006ab70 ( )
protected

[AI] Invokes end-of-animation logic via AnimationManager, depending on mode flag m_unk0x96.

Definition at line 542 of file legoanimpresenter.cpp.

◆ FUN_1006aba0()

LegoBool LegoAnimPresenter::FUN_1006aba0 ( )
protected

[AI] Returns TRUE if every animation actor/ROI node is bound successfully.

Used as precondition if c_mustSucceed set.

Definition at line 553 of file legoanimpresenter.cpp.

◆ FUN_1006abb0()

MxBool LegoAnimPresenter::FUN_1006abb0 ( LegoTreeNode p_node,
LegoROI p_roi 
)
protected

[AI] Recursively validates correct ROI matching/binding in animation tree (helper for FUN_1006aba0).

Parameters
p_nodeAnimation node [AI]
p_roiCurrently considered ROI [AI]
Returns
TRUE if matched through all children, FALSE otherwise [AI]

Definition at line 559 of file legoanimpresenter.cpp.

◆ FUN_1006afc0()

MxResult LegoAnimPresenter::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 state change / blending).

Parameters
p_matrixOutput: matrix array (1-based index, size = mapSize+1) [AI]
p_undAnimation time or interpolation parameter [AI]
Returns
SUCCESS if filled; FAILURE on allocation or missing ROI [AI]

Definition at line 672 of file legoanimpresenter.cpp.

◆ FUN_1006b140()

MxResult LegoAnimPresenter::FUN_1006b140 ( LegoROI p_roi)

[AI] Calculates a blended transformation for a target ROI and applies as base transform for this animation.

Parameters
p_roiTarget ROI to align with animation [AI]
Returns
SUCCESS if transform arrived at, FAILURE otherwise [AI]

Definition at line 701 of file legoanimpresenter.cpp.

◆ FUN_1006b900()

void LegoAnimPresenter::FUN_1006b900 ( LegoAnim p_anim,
MxLong  p_time,
Matrix4 p_matrix 
)
protected

[AI] Steps animation nodes to 'p_time' using transform 'p_matrix', using fast path for tree traversal.

Helper for incremental frame advance.

Parameters
p_animAnimation resource [AI]
p_timeAnimation time [AI]
p_matrixOptional transform [AI]

Definition at line 886 of file legoanimpresenter.cpp.

◆ FUN_1006b9a0()

void LegoAnimPresenter::FUN_1006b9a0 ( LegoAnim p_anim,
MxLong  p_time,
Matrix4 p_matrix 
)
protected

[AI] Like FUN_1006b900, but also processes associated camera animation if present.

Parameters
p_animAnimation resource [AI]
p_timeAnimation time [AI]
p_matrixOptional transform [AI]

Definition at line 911 of file legoanimpresenter.cpp.

◆ FUN_1006c7a0()

void LegoAnimPresenter::FUN_1006c7a0 ( )

[AI] Immediately completes this animation, updates all ROIs to their final pose.

[AI]

Definition at line 1106 of file legoanimpresenter.cpp.

◆ FUN_1006c8a0()

void LegoAnimPresenter::FUN_1006c8a0 ( MxBool  p_bool)
protected

[AI] Enables or disables internal state (LegoEntity c_altBit1) on all animated entities.

Parameters
p_boolTrue to set, false to clear [AI]

Definition at line 1154 of file legoanimpresenter.cpp.

◆ GetActionObjectName()

const char * LegoAnimPresenter::GetActionObjectName ( )

[AI] Gets the name of the object associated with the current animation action.

Returns
Object name, as string pointer [AI]

Definition at line 879 of file legoanimpresenter.cpp.

◆ GetAnimation()

LegoAnim * LegoAnimPresenter::GetAnimation ( )
inline

[AI] Returns the current animation resource in use.

Returns
Pointer to LegoAnim object [AI]

Definition at line 286 of file legoanimpresenter.h.

◆ GetROIMap()

virtual LegoROI ** LegoAnimPresenter::GetROIMap ( MxU32 p_roiMapSize)
virtual

[AI] Returns the mapping array from animation node index to LegoROI*.

Used to accelerate transform updates.

Parameters
p_roiMapSizeOutput, number of elements in the roiMap array [AI]
Returns
Internal ROI map [AI]

◆ HandlerClassName()

static const char * LegoAnimPresenter::HandlerClassName ( )
static

[AI] Returns the class name for this presenter ("LegoAnimPresenter").

Used for RTTI and dispatch.

Returns
Static string representing the handler class name [AI]

◆ Init()

void LegoAnimPresenter::Init ( )
protected

[AI] Allocates and resets all internal presenter state.

Helper for constructor and re-init.

Definition at line 45 of file legoanimpresenter.cpp.

◆ IsA()

MxBool LegoAnimPresenter::IsA ( const char *  p_name) const
overridevirtual

[AI] Checks if this or a parent class matches the given type name for RTTI.

Parameters
p_nameType name string for checking [AI]
Returns
True if type matches or is a parent type; false otherwise [AI]

Reimplemented from MxCore.

Reimplemented in LegoCarBuildAnimPresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, and LegoLoopingAnimPresenter.

◆ ParseExtra()

void LegoAnimPresenter::ParseExtra ( )
overridevirtual

[AI] Extra data parser for animation presenter.

Reads named options (substitution, world binding, etc) from resource chunk.

Reimplemented from MxPresenter.

Definition at line 945 of file legoanimpresenter.cpp.

◆ PutFrame()

void LegoAnimPresenter::PutFrame ( )
overridevirtual

[AI] Called once per frame to push updated animation information (transform, position, etc.) to the ROIs.

Reimplemented from MxVideoPresenter.

Reimplemented in LegoCarBuildAnimPresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, and LegoLoopingAnimPresenter.

Definition at line 623 of file legoanimpresenter.cpp.

◆ ReadyTickle()

void LegoAnimPresenter::ReadyTickle ( )
overridevirtual

[AI] Called when the presenter is in the "Ready" tickle state.

Handles loading animation resource and progressing to Start.

Reimplemented from MxPresenter.

Reimplemented in LegoCarBuildAnimPresenter, LegoHideAnimPresenter, and LegoLocomotionAnimPresenter.

Definition at line 757 of file legoanimpresenter.cpp.

◆ SetCurrentWorld()

void LegoAnimPresenter::SetCurrentWorld ( LegoWorld p_currentWorld)
inline

[AI] Sets the world used by this presenter for actor placement and notification.

Parameters
p_currentWorldWorld to be associated. [AI]

Definition at line 269 of file legoanimpresenter.h.

◆ SetUnknown0x0cTo1()

void LegoAnimPresenter::SetUnknown0x0cTo1 ( )
inline

[AI] Sets the value of internal flag m_unk0x9c to 1.

Related to transform blending/handoff.

Definition at line 274 of file legoanimpresenter.h.

◆ SetUnknown0xa0()

void LegoAnimPresenter::SetUnknown0xa0 ( Matrix4 p_unk0xa0)
inline

[AI] Sets a pointer to the baseline animation transform.

Parameters
p_unk0xa0Matrix pointer, assumed granted to presenter [AI]

Definition at line 280 of file legoanimpresenter.h.

◆ StartAction()

MxResult LegoAnimPresenter::StartAction ( MxStreamController p_controller,
MxDSAction p_action 
)
overridevirtual

[AI] Begin playback action using a stream and a given action descriptor.

Also resets displayZ for 3D layer.

Parameters
p_controllerStream controller, provides actual data source (RAM or disk). [AI]
p_actionDS Action data, describes animation meta. [AI]
Returns
Result indicating success or error. [AI]

Reimplemented from MxPresenter.

Definition at line 1057 of file legoanimpresenter.cpp.

◆ StartingTickle()

void LegoAnimPresenter::StartingTickle ( )
overridevirtual

[AI] Called at the "Starting" tickle state.

Applies substitutions, constructs ROI/actor maps, and prepares the animation to begin streaming.

Reimplemented from MxPresenter.

Reimplemented in LegoHideAnimPresenter, and LegoLocomotionAnimPresenter.

Definition at line 782 of file legoanimpresenter.cpp.

◆ StreamingTickle()

void LegoAnimPresenter::StreamingTickle ( )
overridevirtual

[AI] Tickle function during streaming (active animation).

Advances animation, releases frames, and checks streaming completion.

Reimplemented from MxPresenter.

Reimplemented in LegoCarBuildAnimPresenter, LegoLocomotionAnimPresenter, and LegoLoopingAnimPresenter.

Definition at line 838 of file legoanimpresenter.cpp.

◆ SubstituteVariables()

void LegoAnimPresenter::SubstituteVariables ( )
protected

[AI] Applies all queued variable substitutions in the animation resource by setting corresponding VariableTable entries.

Definition at line 611 of file legoanimpresenter.cpp.

◆ VTable0x8c()

void LegoAnimPresenter::VTable0x8c ( )
virtual

[AI] Virtual callback for future expansion.

Unused in current base. [AI]

Reimplemented in LegoHideAnimPresenter.

Definition at line 1117 of file legoanimpresenter.cpp.

◆ VTable0x90()

void LegoAnimPresenter::VTable0x90 ( )
virtual

[AI] Virtual callback for future expansion.

Unused in current base. [AI]

Reimplemented in LegoHideAnimPresenter.

Definition at line 1140 of file legoanimpresenter.cpp.

◆ VTable0x94()

MxU32 LegoAnimPresenter::VTable0x94 ( Vector3 p_v1,
Vector3 p_v2,
float  p_f1,
float  p_f2,
Vector3 p_v3 
)
virtual

[AI] Tests if a swept segment (defined by v1, v2, f1, f2) collides any of this presenter's animated ROIs.

Used for advanced hit-testing.

Parameters
p_v1Start vector [AI]
p_v2Direction vector [AI]
p_f1Distance along the direction [AI]
p_f2Tolerance/radius [AI]
p_v3Output intersection or closest point [AI]
Returns
TRUE if hit, FALSE otherwise [AI]

Definition at line 1174 of file legoanimpresenter.cpp.

◆ VTable0x98()

MxResult LegoAnimPresenter::VTable0x98 ( LegoPathBoundary p_boundary)
virtual

[AI] Adds all actor ROIs, associated with this animation, to the provided path boundary for grouping or path following.

Parameters
p_boundaryPath boundary to receive actors [AI]
Returns
SUCCESS if all actors are added, FAILURE otherwise [AI]

Definition at line 1204 of file legoanimpresenter.cpp.

◆ VTable0xa0()

void LegoAnimPresenter::VTable0xa0 ( Matrix4 p_matrix)
virtual

[AI] Sets the baseline transform for the animation.

May be used to drive/override animation root node origin.

Parameters
p_matrixMatrix with the new baseline transformation [AI]

Definition at line 1047 of file legoanimpresenter.cpp.

Member Data Documentation

◆ m_anim

LegoAnim* LegoAnimPresenter::m_anim
protected

[AI] Animation resource currently being played back.

[AI] Owns the loaded LegoAnim animation, which may be swapped for each new media action.

Definition at line 416 of file legoanimpresenter.h.

◆ m_currentWorld

LegoWorld* LegoAnimPresenter::m_currentWorld
protected

[AI] Reference to the world in which this presenter is currently placed/active.

[AI] Updated on tickle and used for actor placement/scenes.

Definition at line 455 of file legoanimpresenter.h.

◆ m_flags

MxU32 LegoAnimPresenter::m_flags
protected

[AI] Animation presenter flags (hide-on-stop, must-succeed, etc).

Definition at line 449 of file legoanimpresenter.h.

◆ m_roiMap

LegoROI** LegoAnimPresenter::m_roiMap
protected

[AI] Lookup array to map animation node indices to scene ROIs (1-based index).

[AI] Used for fast node transform updates and collision checks.

Definition at line 422 of file legoanimpresenter.h.

◆ m_roiMapSize

MxU32 LegoAnimPresenter::m_roiMapSize
protected

[AI] Number of valid entries in m_roiMap (excluding 0th index).

Definition at line 427 of file legoanimpresenter.h.

◆ m_substMap

LegoAnimSubstMap* LegoAnimPresenter::m_substMap
protected

[AI] Table of macro/variable substitutions to apply before animation begins (from resource "subst" field).

Definition at line 501 of file legoanimpresenter.h.

◆ m_unk0x70

LegoROIList* LegoAnimPresenter::m_unk0x70
protected

[AI] List of ROIs used during preprocessing, actor matching, or variable substitution (purpose varies).

Definition at line 432 of file legoanimpresenter.h.

◆ m_unk0x74

LegoROIList* LegoAnimPresenter::m_unk0x74
protected

[AI] List of actors/ROIs created or acquired for this animation instance.

[AI] Used for cleanup, visibility toggling, and releasing actors at the end.

Definition at line 438 of file legoanimpresenter.h.

◆ m_unk0x78

Matrix4* LegoAnimPresenter::m_unk0x78
protected

[AI] Pointer to root/offset MxMatrix used for transform computations.

[AI] Used for overall local-to-world transform; may be updated on each action/tickle segment.

Definition at line 444 of file legoanimpresenter.h.

◆ m_unk0x8c

LegoROI** LegoAnimPresenter::m_unk0x8c
protected

[AI] Lookup array for secondary ROI objects (used for e.g.

camera animation attached ROIs by name).

Definition at line 471 of file legoanimpresenter.h.

◆ m_unk0x90

char** LegoAnimPresenter::m_unk0x90
protected

[AI] Array of char* names used for selecting camera attached ROIs (from ptatcam extra parameter).

Definition at line 476 of file legoanimpresenter.h.

◆ m_unk0x94

MxU8 LegoAnimPresenter::m_unk0x94
protected

[AI] Count of valid camera attached ROI names in m_unk0x90 / m_unk0x8c.

Definition at line 481 of file legoanimpresenter.h.

◆ m_unk0x95

MxBool LegoAnimPresenter::m_unk0x95
protected

[AI] Boolean: indicates streaming/animation is finished and presenter should progress to Done state.

Definition at line 486 of file legoanimpresenter.h.

◆ m_unk0x96

MxBool LegoAnimPresenter::m_unk0x96
protected

[AI] Boolean/mode: influences actor release vs animation manager cleanup selection (see FUN_1006ab70).

Definition at line 491 of file legoanimpresenter.h.

◆ m_unk0x97

undefined LegoAnimPresenter::m_unk0x97
protected

[AI] Unknown/unused byte, for possible explicit alignment or hidden flag.

[AI_SUGGESTED_NAME: m_padding0x97]

Definition at line 496 of file legoanimpresenter.h.

◆ m_unk0x9c

MxS16 LegoAnimPresenter::m_unk0x9c
protected

[AI] Int16 state flag, set via SetUnknown0x0cTo1().

Related to animation handoff/transform alignment.

Definition at line 506 of file legoanimpresenter.h.

◆ m_unk0xa0

Matrix4* LegoAnimPresenter::m_unk0xa0
protected

[AI] Optional pointer to a matrix storing a blended/baseline local-to-world transform.

Definition at line 511 of file legoanimpresenter.h.

◆ m_unk0xa4

float LegoAnimPresenter::m_unk0xa4

[AI] Animation touch radius for path boundary checks and state (set from resource).

Definition at line 517 of file legoanimpresenter.h.

◆ m_unk0xa8

Mx3DPointFloat LegoAnimPresenter::m_unk0xa8

[AI] 3D float property, used for animation base position offset.

Definition at line 522 of file legoanimpresenter.h.

◆ m_worldAtom

MxAtomId LegoAnimPresenter::m_worldAtom
protected

[AI] String identifier for the target world (if set in animation resource via extra data).

Definition at line 460 of file legoanimpresenter.h.

◆ m_worldId

MxS32 LegoAnimPresenter::m_worldId
protected

[AI] Numeric world ID for world selection/lookup.

[AI] -1 means no explicit world.

Definition at line 466 of file legoanimpresenter.h.


The documentation for this class was generated from the following files: