implement LegoWorldPresenter::ParseExtra (#551)

This commit is contained in:
Misha 2024-02-10 12:54:38 -05:00 committed by GitHub
parent 27390e80c0
commit f378b2e535
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 1 deletions

View file

@ -104,6 +104,7 @@ class LegoOmni : public MxOmni {
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
void CreateBackgroundAudio();
void RemoveWorld(const MxAtomId&, MxLong);
undefined4 FUN_1005b490(char* p_worldName);
static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&);
static void CreateInstance();

View file

@ -65,6 +65,7 @@ class LegoWorld : public LegoEntity {
virtual void Enable(MxBool p_enable); // vtable+0x68
inline LegoCameraController* GetCamera() { return m_cameraController; }
inline void SetUnknown0xec(undefined4 p_unk0xec) { m_unk0xec = p_unk0xec; }
inline undefined4 GetUnknown0xec() { return m_unk0xec; }
inline MxCoreSet& GetUnknown0xd0() { return m_set0xd0; }

View file

@ -1,5 +1,6 @@
#include "legoworldpresenter.h"
#include "define.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legoentity.h"
@ -16,6 +17,7 @@
#include "mxobjectfactory.h"
#include "mxpresenter.h"
#include "mxstl/stlcompat.h"
#include "mxutil.h"
// GLOBAL: LEGO1 0x100f75d4
undefined4 g_legoWorldPresenterQuality = 1;
@ -147,6 +149,11 @@ void LegoWorldPresenter::StartingTickle()
ProgressTickleState(e_streaming);
}
// STUB: LEGO1 0x10066b40
void LoadWorld(char* p_worldName, LegoWorld* p_world)
{
}
// FUNCTION: LEGO1 0x10067a70
void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter)
{
@ -170,7 +177,21 @@ void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter)
}
}
// STUB: LEGO1 0x10067b00
// FUNCTION: LEGO1 0x10067b00
void LegoWorldPresenter::ParseExtra()
{
char data[1024];
char output[1024];
MxU16 len = m_action->GetExtraLength();
*((MxU16*) &data[0]) = m_action->GetExtraLength();
if (len != 0) {
memcpy(data, m_action->GetExtraData(), len);
data[len] = 0;
if (KeyValueStringParse(output, g_strWORLD, data)) {
char* worldName = strtok(output, g_parseExtraTokens);
LoadWorld(worldName, (LegoWorld*) m_entity);
((LegoWorld*) m_entity)->SetUnknown0xec(Lego()->FUN_1005b490(worldName));
}
}
}

View file

@ -754,6 +754,12 @@ MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value)
return ::CurrentWorld()->GetCurrPathInfo(p_path, p_value);
}
// STUB: LEGO1 0x1005b490
undefined4 LegoOmni::FUN_1005b490(char* p_worldName)
{
return -1;
}
// FUNCTION: LEGO1 0x1005b4f0
void LegoOmni::FUN_1005b4f0(MxBool p_disable, MxU16 p_flags)
{