Finish LegoEntityPresenter::ReadyTickle

This commit is contained in:
Misha 2023-12-26 13:39:44 -05:00
parent 028021a321
commit 8b2f8e5f7f
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
7 changed files with 33 additions and 13 deletions

View File

@ -76,6 +76,12 @@ void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
// TODO
}
// STUB: LEGO1 0x100109b0
void LegoEntity::SetLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up, MxBool)
{
// TODO
}
// STUB: LEGO1 0x10010c30
void LegoEntity::FUN_10010c30()
{

View File

@ -49,6 +49,7 @@ class LegoEntity : public MxEntity {
virtual void VTable0x4c(); // vtable+0x4c
void FUN_10010c30();
void SetLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up, MxBool);
protected:
void Init();

View File

@ -15,7 +15,7 @@ LegoEntityPresenter::LegoEntityPresenter()
// FUNCTION: LEGO1 0x100535c0
void LegoEntityPresenter::Init()
{
m_unk0x4c = 0;
m_objectBackend = 0;
}
// FUNCTION: LEGO1 0x100535d0
@ -25,9 +25,9 @@ LegoEntityPresenter::~LegoEntityPresenter()
}
// FUNCTION: LEGO1 0x10053630
undefined4 LegoEntityPresenter::VTable0x6c(IslePathActor* p_unk0x4c)
undefined4 LegoEntityPresenter::SetBackend(LegoEntity* p_backend)
{
m_unk0x4c = p_unk0x4c;
m_objectBackend = p_backend;
return 0;
}
@ -59,10 +59,19 @@ MxResult LegoEntityPresenter::StartAction(MxStreamController* p_controller, MxDS
return result;
}
// STUB: LEGO1 0x100536c0
// FUNCTION: LEGO1 0x100536c0
void LegoEntityPresenter::ReadyTickle()
{
// TODO
if (GetCurrentWorld()) {
m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoEntity");
if (m_objectBackend) {
m_objectBackend->Create(*m_action);
m_objectBackend->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE);
ParseExtra();
}
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
}
}
// FUNCTION: LEGO1 0x10053720
@ -83,6 +92,6 @@ void LegoEntityPresenter::ParseExtra()
data[len] = 0;
len &= MAXWORD;
m_unk0x4c->ParseAction(data);
m_objectBackend->ParseAction(data);
}
}

View File

@ -3,7 +3,7 @@
#include "mxcompositepresenter.h"
class IslePathActor;
class LegoEntity;
// VTABLE: LEGO1 0x100d8398
// SIZE 0x50
@ -31,12 +31,12 @@ class LegoEntityPresenter : public MxCompositePresenter {
virtual void Destroy() override; // vtable+0x38
virtual MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c
virtual void Init(); // vtable+0x68
virtual undefined4 VTable0x6c(IslePathActor* p_unk0x4c); // vtable+0x6c
virtual undefined4 SetBackend(LegoEntity* p_unk0x4c); // vtable+0x6c
private:
void Destroy(MxBool p_fromDestructor);
IslePathActor* m_unk0x4c;
LegoEntity* m_objectBackend;
};
#endif // LEGOENTITYPRESENTER_H

View File

@ -63,7 +63,9 @@ class MxDSAction : public MxDSObject {
inline MxLong GetStartTime() const { return m_startTime; }
inline MxS32 GetLoopCount() { return m_loopCount; }
inline void SetLoopCount(MxS32 p_loopCount) { m_loopCount = p_loopCount; }
inline const Vector3Data& GetLocation() const { return m_location; }
inline Vector3Data& GetLocation() { return m_location; }
inline Vector3Data& GetDirection() { return m_direction; }
inline Vector3Data& GetUp() { return m_up; }
inline MxCore* GetUnknown84() { return m_unk0x84; }
inline void SetUnknown84(MxCore* p_unk0x84) { m_unk0x84 = p_unk0x84; }
inline MxCore* GetOrigin() { return m_origin; }

View File

@ -9,6 +9,7 @@
#include "mxcompositepresenter.h"
#include "mxdsanim.h"
#include "mxdssound.h"
#include "mxentity.h"
#include "mxnotificationmanager.h"
#include "mxparam.h"
#include "mxstreamer.h"
@ -306,7 +307,7 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
}
// FUNCTION: LEGO1 0x100b5410
void MxPresenter::FUN_100b5410(const char* p_name)
MxEntity* MxPresenter::CreateEntityBackend(const char* p_name)
{
char buffer[512];
char buffer2[512];
@ -323,7 +324,7 @@ void MxPresenter::FUN_100b5410(const char* p_name)
KeyValueStringParse(buffer, g_strOBJECT, buffer2 + 2);
}
ObjectFactory()->Create(buffer);
return (MxEntity*) ObjectFactory()->Create(buffer);
}
// FUNCTION: LEGO1 0x100b54c0

View File

@ -10,6 +10,7 @@
class MxCompositePresenter;
class MxStreamController;
class MxEntity;
// VTABLE: LEGO1 0x100d4d38
// SIZE 0x40
@ -64,7 +65,7 @@ class MxPresenter : public MxCore {
virtual MxResult PutData(); // vtable+0x4c
virtual MxBool IsHit(MxS32 p_x, MxS32 p_y); // vtable+0x50
__declspec(dllexport) virtual void Enable(MxBool p_enable); // vtable+0x54
void FUN_100b5410(const char* p_name);
MxEntity* CreateEntityBackend(const char* p_name);
MxBool IsEnabled();
inline MxS32 GetCurrentTickleState() const { return this->m_currentTickleState; }