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

[AI] Manages the loading, storage, and management of named textures for the LEGO Island engine. More...

#include <legotexturepresenter.h>

Inheritance diagram for LegoTexturePresenter:
Collaboration diagram for LegoTexturePresenter:

Public Member Functions

 LegoTexturePresenter ()
 [AI] Constructs a LegoTexturePresenter and initializes its texture list pointer to NULL. More...
 
 ~LegoTexturePresenter () override
 [AI] Destructor: Unregisters the presenter from the VideoManager and cleans up owned texture data. More...
 
const char * ClassName () const override
 [AI] Returns the dynamic class name for runtime type identification. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Determines if the presenter is or inherits from a given class name. More...
 
void DoneTickle () override
 [AI] Updates this presenter when the tickle state reaches "Done". More...
 
MxResult AddToManager () override
 [AI] Registers this presenter with the VideoManager, making it available for video/texture updates and management. More...
 
MxResult PutData () override
 [AI] Loads texture data from the current data chunk, registers these textures with the global texture container, and manages memory. More...
 
MxResult Read (MxDSChunk &p_chunk)
 [AI] Loads and parses one or more texture objects from a provided serialized data chunk. More...
 
MxResult Store ()
 [AI] Transfers all loaded textures to the global texture container and initializes their info structure. More...
 
- 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 handler class name used for presenter name dispatching and type identification. 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...
 

Additional Inherited Members

- 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...
 
- 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 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] Manages the loading, storage, and management of named textures for the LEGO Island engine.

The LegoTexturePresenter class is responsible for reading texture data from MxDSChunk objects, storing textures to the central texture container, and interfacing with the game's tickle manager for periodic logic updates. It acts as a specialized media presenter focused on the game's streamable texture resources. Instances of LegoTexturePresenter are automatically registered/unregistered with the VideoManager.

[AI] This presenter serves the purpose of deserializing and registering textures present in streamed media files (such as those included in SI scene files) and exposing them to the in-game renderer's container and lookup tables. It supports Direct3D hardware mode selection for optimal rendering.

Definition at line 22 of file legotexturepresenter.h.

Constructor & Destructor Documentation

◆ LegoTexturePresenter()

LegoTexturePresenter::LegoTexturePresenter ( )
inline

[AI] Constructs a LegoTexturePresenter and initializes its texture list pointer to NULL.

Definition at line 27 of file legotexturepresenter.h.

◆ ~LegoTexturePresenter()

LegoTexturePresenter::~LegoTexturePresenter ( )
override

[AI] Destructor: Unregisters the presenter from the VideoManager and cleans up owned texture data.

Definition at line 18 of file legotexturepresenter.cpp.

Member Function Documentation

◆ AddToManager()

MxResult LegoTexturePresenter::AddToManager ( )
overridevirtual

[AI] Registers this presenter with the VideoManager, making it available for video/texture updates and management.

[AI] Called by the tickle/streaming infrastructure when the presenter is activated.

Reimplemented from MxPresenter.

Definition at line 24 of file legotexturepresenter.cpp.

◆ ClassName()

const char * LegoTexturePresenter::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the dynamic class name for runtime type identification.

Returns
[AI] Same as HandlerClassName()

Reimplemented from MxCore.

Definition at line 48 of file legotexturepresenter.h.

◆ DoneTickle()

void LegoTexturePresenter::DoneTickle ( )
overridevirtual

[AI] Updates this presenter when the tickle state reaches "Done".

Handles composite presenters or delegates to base class logic.

Reimplemented from MxPresenter.

Definition at line 140 of file legotexturepresenter.cpp.

◆ HandlerClassName()

static const char * LegoTexturePresenter::HandlerClassName ( )
inlinestatic

[AI] Returns the handler class name used for presenter name dispatching and type identification.

Returns
[AI] "LegoTexturePresenter" (static string)

Definition at line 38 of file legotexturepresenter.h.

◆ IsA()

MxBool LegoTexturePresenter::IsA ( const char *  p_name) const
inlineoverridevirtual

[AI] Determines if the presenter is or inherits from a given class name.

Parameters
p_nameName of the class to check against. [AI]
Returns
[AI] TRUE if the class matches this type or any base class type.

Reimplemented from MxCore.

Definition at line 58 of file legotexturepresenter.h.

◆ PutData()

MxResult LegoTexturePresenter::PutData ( )
overridevirtual

[AI] Loads texture data from the current data chunk, registers these textures with the global texture container, and manages memory.

[AI] Invoked as a presentation step upon new chunk arrival. Frees textures after pushing them to the container.

Reimplemented from MxPresenter.

Definition at line 120 of file legotexturepresenter.cpp.

◆ Read()

MxResult LegoTexturePresenter::Read ( MxDSChunk p_chunk)

[AI] Loads and parses one or more texture objects from a provided serialized data chunk.

[AI] Constructs a LegoNamedTextureList and fills it by reading and parsing each texture blob from the chunk, using the current Direct3D hardware mode and file context. On failure, any allocated resources are correctly cleaned up.

Parameters
p_chunkThe SI file chunk containing serialized texture data. [AI]
Returns
[AI] SUCCESS if all textures are read and parsed, otherwise FAILURE.

Definition at line 31 of file legotexturepresenter.cpp.

◆ Store()

MxResult LegoTexturePresenter::Store ( )

[AI] Transfers all loaded textures to the global texture container and initializes their info structure.

[AI] Each named texture is either created anew within TextureContainer or updates existing ones with new image data. All memory owned by m_textures is freed after successful storage.

Returns
[AI] Always returns SUCCESS.

Definition at line 89 of file legotexturepresenter.cpp.


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