Isle
Loading...
Searching...
No Matches
mxpresenter.h
Go to the documentation of this file.
1#ifndef MXPRESENTER_H
2#define MXPRESENTER_H
3
4#include "decomp.h"
5#include "mxcore.h"
6#include "mxcriticalsection.h"
7#include "mxgeometry.h"
8
10class MxDSAction;
11class MxOmni;
13class MxEntity;
14
18// VTABLE: LEGO1 0x100d4d38
19// SIZE 0x40
20class MxPresenter : public MxCore {
21public:
24 e_idle = 0,
31 };
32
35
39 MxResult Tickle() override; // vtable+0x08
40
42 virtual void VTable0x14() {} // vtable+0x14 [AI_SUGGESTED_NAME: OnCustomTickle]
43
45 virtual void ReadyTickle()
46 {
47 ParseExtra();
49 } // vtable+0x18
50
52 virtual void StartingTickle() { ProgressTickleState(e_streaming); } // vtable+0x1c
53
55 virtual void StreamingTickle() { ProgressTickleState(e_repeating); } // vtable+0x20
56
58 virtual void RepeatingTickle() { ProgressTickleState(e_freezing); } // vtable+0x24
59
61 virtual void FreezingTickle() { ProgressTickleState(e_done); } // vtable+0x28
62
63protected:
65 virtual void DoneTickle() { ProgressTickleState(e_idle); } // vtable+0x2c
66
68 virtual void ParseExtra(); // vtable+0x30
69
72 void ProgressTickleState(TickleState p_tickleState)
73 {
75 m_currentTickleState = p_tickleState;
76 }
77
78public:
80 ~MxPresenter() override {} // vtable+0x00
81
84 virtual MxResult AddToManager() { return SUCCESS; } // vtable+0x34
85
87 virtual void Destroy() { Init(); } // vtable+0x38
88
93 virtual MxResult StartAction(MxStreamController*, MxDSAction*); // vtable+0x3c
94
96 virtual void EndAction(); // vtable+0x40
97
100 virtual void SetTickleState(TickleState p_tickleState) { ProgressTickleState(p_tickleState); } // vtable+0x44
101
106 {
107 return m_previousTickleStates & (1 << (MxU8) p_tickleState);
108 } // vtable+0x48
109
112 virtual MxResult PutData() { return SUCCESS; } // vtable+0x4c
113
118 virtual MxBool IsHit(MxS32 p_x, MxS32 p_y) { return FALSE; } // vtable+0x50
119
122 virtual void Enable(MxBool p_enable); // vtable+0x54
123
126 static const char* HandlerClassName()
127 {
128 // STRING: LEGO1 0x100f0740
129 return "MxPresenter";
130 }
131
133 const char* ClassName() const override // vtable+0x0c
134 {
135 return HandlerClassName();
136 }
137
141 MxBool IsA(const char* p_name) const override // vtable+0x10
142 {
143 return !strcmp(p_name, MxPresenter::ClassName()) || MxCore::IsA(p_name);
144 }
145
149 MxEntity* CreateEntity(const char* p_defaultName);
150
153 void SendToCompositePresenter(MxOmni* p_omni);
154
158
161
163 MxPoint32 GetLocation() const { return this->m_location; }
164
166 MxS32 GetX() const { return this->m_location.GetX(); }
167
169 MxS32 GetY() const { return this->m_location.GetY(); }
170
172 MxS32 GetDisplayZ() const { return this->m_displayZ; }
173
175 MxDSAction* GetAction() const { return this->m_action; }
176
179 void SetAction(MxDSAction* p_action) { m_action = p_action; }
180
183 void SetCompositePresenter(MxCompositePresenter* p_compositePresenter)
184 {
185 m_compositePresenter = p_compositePresenter;
186 }
187
190 void SetDisplayZ(MxS32 p_displayZ) { m_displayZ = p_displayZ; }
191
192 // SYNTHETIC: LEGO1 0x1000c070
193 // MxPresenter::`scalar deleting destructor'
194protected:
196 void Init();
197
200
203
206
209
212
215
218};
219
223const char* PresenterNameDispatch(const MxDSAction&);
224
225#endif // MXPRESENTER_H
[AI] Composite presenter that manages a collection of child presenters, orchestrating their actions a...
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
[AI] Provides a critical section object for mutual exclusion with optional use of OS mutex.
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
MxEntity is a base class for game entities which are uniquely identified by an integer ID and an Atom...
Definition: mxentity.h:22
[AI] Central subsystem coordinator and singleton of the LEGO Island engine.
Definition: mxomni.h:32
[AI] 2D point with 32-bit signed integer coordinates.
Definition: mxgeometry.h:487
T GetY() const
[AI] Get Y coordinate.
Definition: mxgeometry.h:53
T GetX() const
[AI] Get X coordinate.
Definition: mxgeometry.h:48
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
virtual void ParseExtra()
[AI] Parses additional data from the associated action for configuration or world interaction.
Definition: mxpresenter.cpp:80
virtual void SetTickleState(TickleState p_tickleState)
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
Definition: mxpresenter.h:100
MxS32 m_displayZ
[AI] Z-order value for display stacking.
Definition: mxpresenter.h:208
virtual void EndAction()
[AI] Terminates the current action, notifies listeners and resets state.
Definition: mxpresenter.cpp:59
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
Definition: mxpresenter.h:72
virtual void RepeatingTickle()
[AI] Handles updates when in a repeating (looping) stage. Advances to freezing state.
Definition: mxpresenter.h:58
MxPoint32 GetLocation() const
[AI] Returns the presenter's screen location (in pixels).
Definition: mxpresenter.h:163
virtual void Enable(MxBool p_enable)
[AI] Enables or disables this presenter (controls action flags accordingly).
virtual MxResult PutData()
[AI] Allows the presenter to submit pending results or output to the engine.
Definition: mxpresenter.h:112
MxBool IsEnabled()
[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).
static const char * HandlerClassName()
[AI] Returns the handler class name for identification and reflection purposes.
Definition: mxpresenter.h:126
const char * ClassName() const override
[AI] Returns the run-time class name for this presenter.
Definition: mxpresenter.h:133
virtual MxResult StartAction(MxStreamController *, MxDSAction *)
[AI] Initiates presenter for a new action, setting up context and state.
Definition: mxpresenter.cpp:45
MxPresenter()
[AI] Constructor. Initializes internal tickle state and other members.
Definition: mxpresenter.h:34
MxU32 m_previousTickleStates
[AI] Bitfield representing all tickle states that have already occurred during this lifetime.
Definition: mxpresenter.h:202
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
MxS32 GetCurrentTickleState() const
[AI] Returns the current tickle state.
Definition: mxpresenter.h:160
TickleState m_currentTickleState
[AI] Current state in the tickle lifecycle.
Definition: mxpresenter.h:199
virtual MxBool HasTickleStatePassed(TickleState p_tickleState)
[AI] Checks if the specified tickle state has ever been passed since last reset.
Definition: mxpresenter.h:105
virtual void StartingTickle()
[AI] Handles actions required when first starting presentation. Advances to streaming state.
Definition: mxpresenter.h:52
void Init()
[AI] Initializes object state to post-construction defaults.
Definition: mxpresenter.cpp:33
MxS32 GetX() const
[AI] Returns the X coordinate of screen location.
Definition: mxpresenter.h:166
virtual void VTable0x14()
[AI] Reserved for future or specialized use in derived classes.
Definition: mxpresenter.h:42
void SetDisplayZ(MxS32 p_displayZ)
[AI] Sets the display Z (depth) order for the presenter.
Definition: mxpresenter.h:190
virtual void FreezingTickle()
[AI] Handles updates during the freezing/suspended state. Advances to done state.
Definition: mxpresenter.h:61
void SetAction(MxDSAction *p_action)
[AI] Sets the action associated with this presenter.
Definition: mxpresenter.h:179
MxResult Tickle() override
[AI] Main tickle handler, called periodically to progress presenter's internal state.
MxEntity * CreateEntity(const char *p_defaultName)
[AI] Creates an entity based on action 'extra' data, or uses the provided default name.
MxS32 GetDisplayZ() const
[AI] Returns the display Z (depth) order.
Definition: mxpresenter.h:172
MxS32 GetY() const
[AI] Returns the Y coordinate of screen location.
Definition: mxpresenter.h:169
TickleState
[AI] Represents the state of the presenter's tickle (update) lifecycle.
Definition: mxpresenter.h:23
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
Definition: mxpresenter.h:28
@ e_done
[AI] Completed processing the current action.
Definition: mxpresenter.h:30
@ e_idle
[AI] Not processing an action.
Definition: mxpresenter.h:24
@ e_ready
[AI] Prepared to start processing an action.
Definition: mxpresenter.h:25
@ e_freezing
[AI] Temporarily suspending updates or playback.
Definition: mxpresenter.h:29
@ e_starting
[AI] In the process of starting playback/presentation.
Definition: mxpresenter.h:26
@ e_streaming
[AI] Streaming or rendering actively.
Definition: mxpresenter.h:27
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
Definition: mxpresenter.h:214
virtual void StreamingTickle()
[AI] Handles periodic updates during the streaming/presentation stage. Advances to repeating state.
Definition: mxpresenter.h:55
MxCompositePresenter * m_compositePresenter
[AI] Owner composite presenter, if any.
Definition: mxpresenter.h:217
MxBool IsA(const char *p_name) const override
[AI] Determines if this object is of (or inherits) the specified named class.
Definition: mxpresenter.h:141
virtual void Destroy()
[AI] Resets presenter state or cleans up resources after completion/removal.
Definition: mxpresenter.h:87
virtual MxResult AddToManager()
[AI] Optional registration with a manager (such as TickleManager); by default does nothing.
Definition: mxpresenter.h:84
void SendToCompositePresenter(MxOmni *p_omni)
[AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group.
MxPoint32 m_location
[AI] 2D display location for the presenter.
Definition: mxpresenter.h:205
virtual void ReadyTickle()
[AI] Handles the transition and setup for the Ready state. Parses extra action data and advances stat...
Definition: mxpresenter.h:45
void SetCompositePresenter(MxCompositePresenter *p_compositePresenter)
[AI] Sets the composite presenter to notify/join on completion.
Definition: mxpresenter.h:183
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
virtual void DoneTickle()
[AI] Handles any post-completion logic, resetting to idle state.
Definition: mxpresenter.h:65
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....
Definition: mxpresenter.h:118
~MxPresenter() override
[AI] Destructor, cleans up resources (base class: does nothing beyond Init).
Definition: mxpresenter.h:80
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
#define override
Definition: compat.h:21
#define FALSE
Definition: d3drmdef.h:27
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
const char * PresenterNameDispatch(const MxDSAction &)
[AI] Provides a mapping from action object/type to the correct presenter handler class name based on ...
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32