Isle
Loading...
Searching...
No Matches
legoactorpresenter.cpp
Go to the documentation of this file.
2
3#include "legoentity.h"
4#include "misc.h"
5
7
8// FUNCTION: LEGO1 0x10076c30
9void LegoActorPresenter::ReadyTickle()
10{
11 if (CurrentWorld()) {
12 m_entity = (LegoEntity*) CreateEntity("LegoActor");
13 if (m_entity) {
14 SetEntityLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp());
15 m_entity->Create(*m_action);
16 }
17 ProgressTickleState(e_starting);
18 }
19}
20
21// FUNCTION: LEGO1 0x10076c90
23{
24 if (m_entity->GetROI()) {
26 ParseExtra();
27 }
28}
29
30// FUNCTION: LEGO1 0x10076cc0
32{
33 MxU16 extraLength;
34 char* extraData;
35 m_action->GetExtra(extraLength, extraData);
36
37 if (extraLength) {
38 char extraCopy[512];
39 memcpy(extraCopy, extraData, extraLength);
40 extraCopy[extraLength] = '\0';
41
42 m_entity->ParseAction(extraCopy);
43 }
44}
[AI] Handles presentation logic specific to LegoActor entities, such as their instantiation,...
void StartingTickle() override
[AI] Implements the "starting" tickle state, finalizing initialization and transitioning to streaming...
void ParseExtra() override
[AI] Parses extra script data attached to the action, passing it to the entity for command execution.
LegoEntity * m_entity
[AI] The entity instance managed by this presenter, typically created based on the current action.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
Definition: legoentity.h:161
virtual void ParseAction(char *p_extra)
[AI] Parses an action description string (usually from script "extra" data) and sets up this entity's...
Definition: legoentity.cpp:236
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
Definition: mxdsaction.h:168
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
Definition: mxpresenter.h:72
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
@ e_streaming
[AI] Streaming or rendering actively.
Definition: mxpresenter.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
unsigned short MxU16
[AI]
Definition: mxtypes.h:20