Address review comments

This commit is contained in:
jonschz 2024-07-01 18:36:10 +02:00
parent 6c0ea3efe7
commit ef58f3265b
2 changed files with 46 additions and 34 deletions

View File

@ -4,37 +4,10 @@
#include "legocarraceactor.h" #include "legocarraceactor.h"
#include "legoracemap.h" #include "legoracemap.h"
// SIZE 0x08
struct EdgeReference { struct EdgeReference {
char* m_name; const char* m_name; // 0x00
LegoPathBoundary* m_data; LegoPathBoundary* m_data; // 0x04
};
// GLOBAL: LEGO1 0x100f0a20
static EdgeReference g_edgeReferences[] = {
{// STRING: LEGO1 0x100f0a10
"EDG03_772",
NULL
},
{// STRING: LEGO1 0x100f0a04
"EDG03_773",
NULL
},
{// STRING: LEGO1 0x100f09f8
"EDG03_774",
NULL
},
{// STRING: LEGO1 0x100f09ec
"EDG03_775",
NULL
},
{// STRING: LEGO1 0x100f09e0
"EDG03_776",
NULL
},
{// STRING: LEGO1 0x100f09d4
"EDG03_777",
NULL
}
}; };
// VTABLE: LEGO1 0x100d58a0 LegoRaceActor // VTABLE: LEGO1 0x100d58a0 LegoRaceActor
@ -94,6 +67,12 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
LegoAnimActorStruct* m_unk0x74; // 0x74 LegoAnimActorStruct* m_unk0x74; // 0x74
LegoPathBoundary* m_unk0x78; // 0x78 LegoPathBoundary* m_unk0x78; // 0x78
LegoPathBoundary* m_unk0x7c; // 0x7c LegoPathBoundary* m_unk0x7c; // 0x7c
// GLOBAL: LEGO1 0x100f0a20
static EdgeReference g_edgeReferences[];
// GLOBAL: LEGO1 0x100f0a50
static const EdgeReference* g_pEdgeReferences;
}; };
#endif // LEGORACECAR_H #endif // LEGORACECAR_H

View File

@ -7,8 +7,38 @@
#include "mxnotificationmanager.h" #include "mxnotificationmanager.h"
#include "mxutilities.h" #include "mxutilities.h"
DECOMP_SIZE_ASSERT(EdgeReference, 0x08)
DECOMP_SIZE_ASSERT(LegoRaceCar, 0x200) DECOMP_SIZE_ASSERT(LegoRaceCar, 0x200)
EdgeReference LegoRaceCar::g_edgeReferences[] = {
{// STRING: LEGO1 0x100f0a10
"EDG03_772",
NULL
},
{// STRING: LEGO1 0x100f0a04
"EDG03_773",
NULL
},
{// STRING: LEGO1 0x100f09f8
"EDG03_774",
NULL
},
{// STRING: LEGO1 0x100f09ec
"EDG03_775",
NULL
},
{// STRING: LEGO1 0x100f09e0
"EDG03_776",
NULL
},
{// STRING: LEGO1 0x100f09d4
"EDG03_777",
NULL
}
};
const EdgeReference* LegoRaceCar::g_pEdgeReferences = g_edgeReferences;
// FUNCTION: LEGO1 0x10012950 // FUNCTION: LEGO1 0x10012950
LegoRaceCar::LegoRaceCar() LegoRaceCar::LegoRaceCar()
{ {
@ -42,9 +72,10 @@ void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed)
m_maxLinearVel = p_worldSpeed; m_maxLinearVel = p_worldSpeed;
} }
LegoAnimActor::SetWorldSpeed(p_worldSpeed); LegoAnimActor::SetWorldSpeed(p_worldSpeed);
return;
} }
else {
m_worldSpeed = p_worldSpeed; m_worldSpeed = p_worldSpeed;
}
} }
// FUNCTION: LEGO1 0x10012ea0 // FUNCTION: LEGO1 0x10012ea0
@ -86,9 +117,11 @@ void LegoRaceCar::ParseAction(char* p_extra)
} }
// STRING: LEGO1 0x100f0bc4 // STRING: LEGO1 0x100f0bc4
m_unk0x78 = currentWorld->FindPathBoundary("EDG03_44"); const char* EDGE_03_44 = "EDG03_44";
m_unk0x78 = currentWorld->FindPathBoundary(EDGE_03_44);
// STRING: LEGO1 0x100f0bb8 // STRING: LEGO1 0x100f0bb8
m_unk0x7c = currentWorld->FindPathBoundary("EDG03_54"); const char* EDGE_03_54 = "EDG03_54";
m_unk0x7c = currentWorld->FindPathBoundary(EDGE_03_54);
for (MxS32 j = 0; j < sizeOfArray(g_edgeReferences); j++) { for (MxS32 j = 0; j < sizeOfArray(g_edgeReferences); j++) {
g_edgeReferences[j].m_data = currentWorld->FindPathBoundary(g_edgeReferences[j].m_name); g_edgeReferences[j].m_data = currentWorld->FindPathBoundary(g_edgeReferences[j].m_name);