Isle
|
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing the lifecycle of the presentation of actions and their corresponding tickle (update) state. More...
#include <mxpresenter.h>
Public Types | |
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 | |
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... | |
MxEntity * | CreateEntity (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... | |
MxDSAction * | GetAction () 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... | |
![]() | |
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 handler class name for identification and reflection purposes. More... | |
Protected Member Functions | |
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 | |
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... | |
MxDSAction * | m_action |
[AI] The associated action currently being presented by this presenter. More... | |
MxCriticalSection | m_criticalSection |
[AI] Thread synchronization for presenter state and data. More... | |
MxCompositePresenter * | m_compositePresenter |
[AI] Owner composite presenter, if any. More... | |
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing the lifecycle of the presentation of actions and their corresponding tickle (update) state.
The presenter tracks and transitions its tickle state and serves as an interface for derived classes which implement rendering, sound, and other forms of presentation logic.
[AI] Presenters are tickled by the engine and handle different stages of playback (idle, ready, starting, streaming, repeating, freezing, done). Each presenter holds an associated action (MxDSAction), its location, display depth order (Z), and optionally links to a composite presenter for hierarchical composition of presentational logic. Most derived classes correspond to specific media types or action groupings.
Definition at line 20 of file mxpresenter.h.
[AI] Represents the state of the presenter's tickle (update) lifecycle.
Definition at line 23 of file mxpresenter.h.
|
inline |
[AI] Constructor. Initializes internal tickle state and other members.
Definition at line 34 of file mxpresenter.h.
|
inlineoverride |
[AI] Destructor, cleans up resources (base class: does nothing beyond Init).
Definition at line 80 of file mxpresenter.h.
|
inlinevirtual |
[AI] Optional registration with a manager (such as TickleManager); by default does nothing.
Reimplemented in Lego3DWavePresenter, LegoActionControlPresenter, LegoAnimPresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, LegoPartPresenter, LegoPathPresenter, LegoTexturePresenter, MxControlPresenter, MxEventPresenter, MxLoopingFlcPresenter, MxLoopingSmkPresenter, MxMusicPresenter, MxSmkPresenter, MxSoundPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 84 of file mxpresenter.h.
|
inlineoverridevirtual |
[AI] Returns the run-time class name for this presenter.
Reimplemented from MxCore.
Reimplemented in MxSmkPresenter, MxSoundPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 133 of file mxpresenter.h.
MxEntity * MxPresenter::CreateEntity | ( | const char * | p_defaultName | ) |
[AI] Creates an entity based on action 'extra' data, or uses the provided default name.
p_defaultName | [AI] Fallback name to use if no OBJECT: key found in action extra data. |
Definition at line 241 of file mxpresenter.cpp.
|
inlinevirtual |
[AI] Resets presenter state or cleans up resources after completion/removal.
Reimplemented in Lego3DWavePresenter, LegoAnimPresenter, LegoEntityPresenter, LegoHideAnimPresenter, LegoInputManager, LegoLocomotionAnimPresenter, LegoModelPresenter, LegoPalettePresenter, LegoPartPresenter, LegoPathPresenter, MxEventPresenter, MxLoopingFlcPresenter, MxLoopingSmkPresenter, MxMediaPresenter, MxMIDIPresenter, MxMusicPresenter, MxSmkPresenter, MxSoundPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 87 of file mxpresenter.h.
|
inlineprotectedvirtual |
[AI] Handles any post-completion logic, resetting to idle state.
Reimplemented in LegoAnimMMPresenter, LegoAnimPresenter, LegoLoadCacheSoundPresenter, LegoTexturePresenter, MxLoopingMIDIPresenter, MxMediaPresenter, MxMIDIPresenter, and MxWavePresenter.
Definition at line 65 of file mxpresenter.h.
|
virtual |
[AI] Enables or disables this presenter (controls action flags accordingly).
p_enable | [AI] TRUE to enable, FALSE to disable. |
Reimplemented in MxControlPresenter, MxCompositePresenter, MxMediaPresenter, MxStillPresenter, and MxWavePresenter.
Definition at line 171 of file mxpresenter.cpp.
|
virtual |
[AI] Terminates the current action, notifies listeners and resets state.
Reimplemented in LegoAnimMMPresenter, LegoAnimPresenter, LegoCarBuildAnimPresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, LegoPhonemePresenter, MxControlPresenter, MxCompositePresenter, MxMediaPresenter, MxMIDIPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 59 of file mxpresenter.cpp.
|
inlinevirtual |
[AI] Handles updates during the freezing/suspended state. Advances to done state.
Reimplemented in MxVideoPresenter.
Definition at line 61 of file mxpresenter.h.
|
inline |
[AI] Returns the current action being presented.
Definition at line 175 of file mxpresenter.h.
|
inline |
[AI] Returns the current tickle state.
Definition at line 160 of file mxpresenter.h.
|
inline |
[AI] Returns the display Z (depth) order.
Definition at line 172 of file mxpresenter.h.
|
inline |
[AI] Returns the presenter's screen location (in pixels).
Definition at line 163 of file mxpresenter.h.
|
inline |
[AI] Returns the X coordinate of screen location.
Definition at line 166 of file mxpresenter.h.
|
inline |
[AI] Returns the Y coordinate of screen location.
Definition at line 169 of file mxpresenter.h.
|
inlinestatic |
[AI] Returns the handler class name for identification and reflection purposes.
Definition at line 126 of file mxpresenter.h.
|
inlinevirtual |
[AI] Checks if the specified tickle state has ever been passed since last reset.
p_tickleState | [AI] The tickle state to check for. |
Reimplemented in MxControlPresenter, and MxCompositePresenter.
Definition at line 105 of file mxpresenter.h.
|
protected |
[AI] Initializes object state to post-construction defaults.
Definition at line 33 of file mxpresenter.cpp.
|
inlineoverridevirtual |
[AI] Determines if this object is of (or inherits) the specified named class.
p_name | [AI] Name of the class to check for. |
Reimplemented from MxCore.
Reimplemented in MxSmkPresenter, MxSoundPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 141 of file mxpresenter.h.
MxBool MxPresenter::IsEnabled | ( | ) |
[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).
Definition at line 265 of file mxpresenter.cpp.
[AI] Returns TRUE if the given (x, y) falls within hit-test bounds for the presenter (e.g.
clickable geometry).
p_x | [AI] X position to test. |
p_y | [AI] Y position to test. |
Reimplemented in MxVideoPresenter.
Definition at line 118 of file mxpresenter.h.
|
protectedvirtual |
[AI] Parses additional data from the associated action for configuration or world interaction.
Reimplemented in LegoActionControlPresenter, LegoActorPresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoEntityPresenter, LegoMeterPresenter, LegoModelPresenter, LegoPathPresenter, LegoWorldPresenter, MxControlPresenter, MxStillPresenter, and MxWavePresenter.
Definition at line 80 of file mxpresenter.cpp.
|
inlineprotected |
[AI] Helper for advancing the presenter's tickle state and updating transition history.
p_tickleState | [AI] New tickle state to transition to. |
Definition at line 72 of file mxpresenter.h.
|
inlinevirtual |
[AI] Allows the presenter to submit pending results or output to the engine.
[AI] Placeholder implementation, always returns SUCCESS.
Reimplemented in LegoInputManager, LegoLoadCacheSoundPresenter, LegoTexturePresenter, MxCompositeMediaPresenter, MxEventPresenter, MxLoopingMIDIPresenter, MxMIDIPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 112 of file mxpresenter.h.
|
inlinevirtual |
[AI] Handles the transition and setup for the Ready state. Parses extra action data and advances state.
Reimplemented in LegoActionControlPresenter, LegoActorPresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoCarBuildAnimPresenter, LegoEntityPresenter, LegoHideAnimPresenter, LegoLoadCacheSoundPresenter, LegoLocomotionAnimPresenter, LegoModelPresenter, LegoPalettePresenter, LegoPartPresenter, LegoPathPresenter, LegoWorldPresenter, MxControlPresenter, MxEventPresenter, MxMIDIPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 45 of file mxpresenter.h.
|
inlinevirtual |
[AI] Handles updates when in a repeating (looping) stage. Advances to freezing state.
Reimplemented in LegoActionControlPresenter, LegoAnimMMPresenter, LegoCarBuildAnimPresenter, LegoEntityPresenter, LegoMeterPresenter, LegoPathPresenter, MxControlPresenter, MxLoopingFlcPresenter, MxLoopingSmkPresenter, MxMediaPresenter, MxStillPresenter, and MxVideoPresenter.
Definition at line 58 of file mxpresenter.h.
void MxPresenter::SendToCompositePresenter | ( | MxOmni * | p_omni | ) |
[AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group.
p_omni | [AI] The central engine context; may be NULL to retrieve singleton instance. |
Definition at line 114 of file mxpresenter.cpp.
|
inline |
[AI] Sets the action associated with this presenter.
p_action | [AI] Action to associate with the presenter. |
Definition at line 179 of file mxpresenter.h.
|
inline |
[AI] Sets the composite presenter to notify/join on completion.
p_compositePresenter | [AI] Composite presenter instance to associate. |
Definition at line 183 of file mxpresenter.h.
|
inline |
[AI] Sets the display Z (depth) order for the presenter.
p_displayZ | [AI] Z order value. |
Definition at line 190 of file mxpresenter.h.
|
inlinevirtual |
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
p_tickleState | [AI] The tickle state to transition into. |
Reimplemented in MxCompositePresenter.
Definition at line 100 of file mxpresenter.h.
|
virtual |
[AI] Initiates presenter for a new action, setting up context and state.
p_controller | [AI] Stream controller supplying data for the action (can be NULL for some presenters). |
p_action | [AI] Action to be presented. |
Reimplemented in MxControlPresenter, MxMediaPresenter, MxCompositeMediaPresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoEntityPresenter, LegoWorldPresenter, and MxCompositePresenter.
Definition at line 45 of file mxpresenter.cpp.
|
inlinevirtual |
[AI] Handles actions required when first starting presentation. Advances to streaming state.
Reimplemented in Lego3DWavePresenter, LegoActorPresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoFlcTexturePresenter, LegoHideAnimPresenter, LegoLocomotionAnimPresenter, LegoPhonemePresenter, LegoWorldPresenter, MxCompositeMediaPresenter, MxEventPresenter, MxMIDIPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 52 of file mxpresenter.h.
|
inlinevirtual |
[AI] Handles periodic updates during the streaming/presentation stage. Advances to repeating state.
Reimplemented in Lego3DWavePresenter, LegoAnimMMPresenter, LegoAnimPresenter, LegoCarBuildAnimPresenter, LegoLoadCacheSoundPresenter, LegoLocomotionAnimPresenter, LegoLoopingAnimPresenter, LegoMeterPresenter, LegoPathPresenter, MxLoopingMIDIPresenter, MxMediaPresenter, MxMIDIPresenter, MxStillPresenter, MxVideoPresenter, and MxWavePresenter.
Definition at line 55 of file mxpresenter.h.
|
overridevirtual |
[AI] Main tickle handler, called periodically to progress presenter's internal state.
[AI] Depending on the current tickle state, will delegate to the appropriate stage tickle method.
Reimplemented from MxCore.
Definition at line 126 of file mxpresenter.cpp.
|
inlinevirtual |
[AI] Reserved for future or specialized use in derived classes.
Definition at line 42 of file mxpresenter.h.
|
protected |
[AI] The associated action currently being presented by this presenter.
Definition at line 211 of file mxpresenter.h.
|
protected |
[AI] Owner composite presenter, if any.
Definition at line 217 of file mxpresenter.h.
|
protected |
[AI] Thread synchronization for presenter state and data.
Definition at line 214 of file mxpresenter.h.
|
protected |
[AI] Current state in the tickle lifecycle.
Definition at line 199 of file mxpresenter.h.
|
protected |
[AI] Z-order value for display stacking.
Definition at line 208 of file mxpresenter.h.
|
protected |
[AI] 2D display location for the presenter.
Definition at line 205 of file mxpresenter.h.
|
protected |
[AI] Bitfield representing all tickle states that have already occurred during this lifetime.
Definition at line 202 of file mxpresenter.h.