mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Implement/match LegoPathController::Read (#904)
* Implement/match LegoPathController::Read * Add size asserts
This commit is contained in:

committed by
GitHub

parent
5df947dbb9
commit
f442f1a2f7
@@ -8,6 +8,13 @@ DECOMP_SIZE_ASSERT(LegoPathBoundary, 0x74)
|
||||
// STUB: LEGO1 0x10056a70
|
||||
LegoPathBoundary::LegoPathBoundary()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10057260
|
||||
LegoPathBoundary::~LegoPathBoundary()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100573f0
|
||||
|
@@ -1,18 +1,21 @@
|
||||
#include "legopathcontroller.h"
|
||||
|
||||
#include "legopathstruct.h"
|
||||
#include "misc/legostorage.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxtimer.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoPathController, 0x40)
|
||||
DECOMP_SIZE_ASSERT(LegoPathCtrlEdge, 0x40)
|
||||
|
||||
// FUNCTION: LEGO1 0x10044f40
|
||||
// FUNCTION: BETA10 0x100b6860
|
||||
LegoPathController::LegoPathController()
|
||||
{
|
||||
m_unk0x08 = NULL;
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x10 = 0;
|
||||
m_unk0x14 = 0;
|
||||
m_unk0x0c = NULL;
|
||||
m_unk0x10 = NULL;
|
||||
m_unk0x14 = NULL;
|
||||
m_numL = 0;
|
||||
m_numE = 0;
|
||||
m_numN = 0;
|
||||
@@ -20,7 +23,7 @@ LegoPathController::LegoPathController()
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10045880
|
||||
void LegoPathController::VTable0x14(MxU8* p_data, Vector3& p_location, MxAtomId& p_trigger)
|
||||
void LegoPathController::Create(MxU8* p_data, Vector3& p_location, MxAtomId& p_trigger)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
@@ -118,3 +121,94 @@ void LegoPathController::Enable(MxBool p_enable)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10046e50
|
||||
// FUNCTION: BETA10 0x100b781f
|
||||
MxResult LegoPathController::Read(LegoStorage* p_storage)
|
||||
{
|
||||
if (p_storage->Read(&m_numT, sizeof(m_numT)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (m_numT > 0) {
|
||||
m_unk0x14 = new LegoPathStruct[m_numT];
|
||||
}
|
||||
|
||||
if (p_storage->Read(&m_numN, sizeof(m_numN)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (m_numN > 0) {
|
||||
m_unk0x10 = new Mx3DPointFloat[m_numN];
|
||||
}
|
||||
|
||||
if (p_storage->Read(&m_numE, sizeof(m_numE)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (m_numE > 0) {
|
||||
m_unk0x0c = new LegoPathCtrlEdge[m_numE];
|
||||
}
|
||||
|
||||
if (p_storage->Read(&m_numL, sizeof(m_numL)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (m_numL > 0) {
|
||||
m_unk0x08 = new LegoPathBoundary[m_numL];
|
||||
}
|
||||
|
||||
if (m_numT > 0 && FUN_10047b30(p_storage) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (m_numN > 0) {
|
||||
for (MxS32 i = 0; i < m_numN; i++) {
|
||||
if (FUN_100482b0(p_storage, m_unk0x10[i]) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_numE > 0 && FUN_10047c10(p_storage) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (m_numL > 0 && FUN_10047e90(p_storage) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
for (MxS32 j = 0; j < m_numE; j++) {
|
||||
m_pfsE.insert(&m_unk0x0c[j]);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10047b30
|
||||
// FUNCTION: BETA10 0x100b7cd6
|
||||
MxResult LegoPathController::FUN_10047b30(LegoStorage* p_storage)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10047c10
|
||||
// FUNCTION: BETA10 0x1100b7df3
|
||||
MxResult LegoPathController::FUN_10047c10(LegoStorage* p_storage)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10047e90
|
||||
// FUNCTION: BETA10 0x100b8293
|
||||
MxResult LegoPathController::FUN_10047e90(LegoStorage* p_storage)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100482b0
|
||||
// FUNCTION: BETA10 0x100b8864
|
||||
MxResult LegoPathController::FUN_100482b0(LegoStorage* p_storage, Mx3DPointFloat&)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@@ -70,9 +70,9 @@ void LegoPathPresenter::Destroy()
|
||||
// FUNCTION: LEGO1 0x10044c20
|
||||
void LegoPathPresenter::ReadyTickle()
|
||||
{
|
||||
LegoWorld* currentWorld = CurrentWorld();
|
||||
LegoWorld* world = CurrentWorld();
|
||||
|
||||
if (currentWorld) {
|
||||
if (world) {
|
||||
MxStreamChunk* chunk = m_subscriber->PopData();
|
||||
|
||||
if (chunk) {
|
||||
@@ -84,8 +84,8 @@ void LegoPathPresenter::ReadyTickle()
|
||||
else {
|
||||
ParseExtra();
|
||||
|
||||
controller->VTable0x14(chunk->GetData(), m_action->GetLocation(), m_trigger);
|
||||
currentWorld->AddPath(controller);
|
||||
controller->Create(chunk->GetData(), m_action->GetLocation(), m_trigger);
|
||||
world->AddPath(controller);
|
||||
|
||||
m_subscriber->FreeDataChunk(chunk);
|
||||
ProgressTickleState(MxPresenter::e_starting);
|
||||
|
11
LEGO1/lego/legoomni/src/paths/legopathstruct.cpp
Normal file
11
LEGO1/lego/legoomni/src/paths/legopathstruct.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "legopathstruct.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoPathStructBase, 0x0c)
|
||||
DECOMP_SIZE_ASSERT(LegoPathStruct, 0x14)
|
||||
|
||||
// STUB: LEGO1 0x1001b700
|
||||
// FUNCTION: BETA10 0x100c26c5
|
||||
void LegoPathStruct::VTable0x04(undefined4, undefined4, undefined4)
|
||||
{
|
||||
// TODO
|
||||
}
|
Reference in New Issue
Block a user