diff --git a/LEGO1/legoentitypresenter.cpp b/LEGO1/legoentitypresenter.cpp index ea484cf1..b5b0b565 100644 --- a/LEGO1/legoentitypresenter.cpp +++ b/LEGO1/legoentitypresenter.cpp @@ -82,6 +82,15 @@ void LegoEntityPresenter::RepeatingTickle() } } +// FUNCTION: LEGO1 0x10053730 +void LegoEntityPresenter::SetBackendLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up) +{ + if (m_objectBackend) + { + m_objectBackend->SetLocation(p_location, p_direction, p_up, TRUE); + } +} + // FUNCTION: LEGO1 0x10053750 void LegoEntityPresenter::ParseExtra() { diff --git a/LEGO1/legoentitypresenter.h b/LEGO1/legoentitypresenter.h index 847a6b8f..47e0b259 100644 --- a/LEGO1/legoentitypresenter.h +++ b/LEGO1/legoentitypresenter.h @@ -32,10 +32,11 @@ class LegoEntityPresenter : public MxCompositePresenter { virtual MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c virtual void Init(); // vtable+0x68 virtual undefined4 SetBackend(LegoEntity* p_unk0x4c); // vtable+0x6c + void SetBackendLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up); private: void Destroy(MxBool p_fromDestructor); - +protected: LegoEntity* m_objectBackend; // 0x4c }; diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index cd3438a7..95d6daf6 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -568,6 +568,12 @@ LegoOmni* LegoOmni::GetInstance() return (LegoOmni*) MxOmni::GetInstance(); } +// FUNCTION: LEGO1 0x1005ad20 +void LegoOmni::AddWorld(LegoWorld* world) +{ + m_worldList->Append(world); +} + // STUB: LEGO1 0x1005af10 void LegoOmni::RemoveWorld(const MxAtomId&, MxLong) { diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index 69f6964a..519b8f84 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -98,6 +98,7 @@ class LegoOmni : public MxOmni { virtual void StopTimer() override; // vtable+3c LegoEntity* FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_entityid); + void AddWorld(LegoWorld* world); LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; } LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; } diff --git a/LEGO1/legoworldpresenter.cpp b/LEGO1/legoworldpresenter.cpp index 9cd12880..4c52db3d 100644 --- a/LEGO1/legoworldpresenter.cpp +++ b/LEGO1/legoworldpresenter.cpp @@ -1,5 +1,8 @@ #include "legoworldpresenter.h" +#include "legoentity.h" +#include "legoomni.h" + // GLOBAL: LEGO1 0x100f75d4 undefined4 g_legoWorldPresenterQuality = 1; @@ -20,3 +23,38 @@ LegoWorldPresenter::~LegoWorldPresenter() { // TODO } + +// STUB: LEGO1 0x10066870 +MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action) +{ + return FAILURE; +} +// FUNCTION: LEGO1 0x10066a50 +void LegoWorldPresenter::ReadyTickle() +{ + m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoWorld"); + if (m_objectBackend) { + m_objectBackend->Create(*m_action); + Lego()->AddWorld((LegoWorld*) m_objectBackend); + SetBackendLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp()); + } + + ParseExtra(); + m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; + m_currentTickleState = TickleState_Starting; +} + +// STUB: LEGO1 0x10067a70 +void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter) +{ +} + +// STUB: LEGO1 0x10066ac0 +void LegoWorldPresenter::StartingTickle() +{ +} + +// FUNCTION: LEGO1 0x10067b00 +void LegoWorldPresenter::ParseExtra() +{ +} diff --git a/LEGO1/legoworldpresenter.h b/LEGO1/legoworldpresenter.h index bcae2f5e..3cd02a8f 100644 --- a/LEGO1/legoworldpresenter.h +++ b/LEGO1/legoworldpresenter.h @@ -25,6 +25,12 @@ class LegoWorldPresenter : public LegoEntityPresenter { return !strcmp(p_name, LegoWorldPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name); } + virtual void ReadyTickle() override; // vtable+0x18 + virtual void StartingTickle() override; // vtable+0x1c + virtual void ParseExtra() override; // vtable+0x30 + virtual MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c + virtual void VTable0x60(MxPresenter* p_presenter) override; // vtable+0x60 + private: undefined4 m_unk0x50; };