LegoActorPresenter

This commit is contained in:
Misha 2024-01-13 16:17:42 -05:00
parent 5b8ea35756
commit 205bdf1ec5
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
4 changed files with 46 additions and 0 deletions

View File

@ -60,6 +60,7 @@ add_library(lego1 SHARED
LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp
LEGO1/lego/legoomni/src/control/mxcontrolpresenter.cpp LEGO1/lego/legoomni/src/control/mxcontrolpresenter.cpp
LEGO1/lego/legoomni/src/entity/legoactor.cpp LEGO1/lego/legoomni/src/entity/legoactor.cpp
LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp
LEGO1/lego/legoomni/src/entity/legoanimactor.cpp LEGO1/lego/legoomni/src/entity/legoanimactor.cpp
LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp
LEGO1/lego/legoomni/src/entity/legoentity.cpp LEGO1/lego/legoomni/src/entity/legoentity.cpp

View File

@ -19,6 +19,10 @@ class LegoActorPresenter : public LegoEntityPresenter {
{ {
return !strcmp(p_name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name); return !strcmp(p_name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name);
} }
virtual void ReadyTickle() override; // vtable+0x18
virtual void StartingTickle() override; // vtable+0x1c
virtual void ParseExtra(); // vtable+0x30
}; };
#endif // LEGOACTORPRESENTER_H #endif // LEGOACTORPRESENTER_H

View File

@ -52,6 +52,8 @@ class LegoEntity : public MxEntity {
void FUN_10010c30(); void FUN_10010c30();
void SetLocation(Mx3DPointFloat& p_location, Mx3DPointFloat& p_direction, Mx3DPointFloat& p_up, MxBool); void SetLocation(Mx3DPointFloat& p_location, Mx3DPointFloat& p_direction, Mx3DPointFloat& p_up, MxBool);
inline LegoROI* GetROI() { return m_roi; }
protected: protected:
void Init(); void Init();
void SetWorld(); void SetWorld();

View File

@ -0,0 +1,39 @@
#include "legoactorpresenter.h"
#include "legoentity.h"
#include "legoomni.h"
// FUNCTION: LEGO1 0x10076c30
void LegoActorPresenter::ReadyTickle()
{
if (GetCurrentWorld()) {
m_objectBackend = (LegoEntity*) CreateEntityBackend("LegoActor");
if (m_objectBackend) {
SetBackendLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp());
m_objectBackend->Create(*m_action);
}
ProgressTickleState(TickleState_Starting);
}
}
// FUNCTION: LEGO1 0x10076c90
void LegoActorPresenter::StartingTickle()
{
if (m_objectBackend->GetROI()) {
ProgressTickleState(TickleState_Streaming);
ParseExtra();
}
}
// FUNCTION: LEGO1 0x10076cc0
void LegoActorPresenter::ParseExtra()
{
char buffer[512];
char* extraData = m_action->GetExtraData();
if (m_action->GetExtraLength()) {
memcpy(buffer, extraData, m_action->GetExtraLength());
buffer[m_action->GetExtraLength()] = 0;
m_objectBackend->ParseAction(buffer);
}
}