From ef58f3265b2c0b72fe283867a78ba6f2e485138a Mon Sep 17 00:00:00 2001 From: jonschz Date: Mon, 1 Jul 2024 18:36:10 +0200 Subject: [PATCH] Address review comments --- LEGO1/lego/legoomni/include/legoracecar.h | 39 +++++-------------- LEGO1/lego/legoomni/src/race/legoracecar.cpp | 41 ++++++++++++++++++-- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoracecar.h b/LEGO1/lego/legoomni/include/legoracecar.h index 673fff8d..da59d0fd 100644 --- a/LEGO1/lego/legoomni/include/legoracecar.h +++ b/LEGO1/lego/legoomni/include/legoracecar.h @@ -4,37 +4,10 @@ #include "legocarraceactor.h" #include "legoracemap.h" +// SIZE 0x08 struct EdgeReference { - char* m_name; - LegoPathBoundary* m_data; -}; - -// 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 - } + const char* m_name; // 0x00 + LegoPathBoundary* m_data; // 0x04 }; // VTABLE: LEGO1 0x100d58a0 LegoRaceActor @@ -94,6 +67,12 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { LegoAnimActorStruct* m_unk0x74; // 0x74 LegoPathBoundary* m_unk0x78; // 0x78 LegoPathBoundary* m_unk0x7c; // 0x7c + + // GLOBAL: LEGO1 0x100f0a20 + static EdgeReference g_edgeReferences[]; + + // GLOBAL: LEGO1 0x100f0a50 + static const EdgeReference* g_pEdgeReferences; }; #endif // LEGORACECAR_H diff --git a/LEGO1/lego/legoomni/src/race/legoracecar.cpp b/LEGO1/lego/legoomni/src/race/legoracecar.cpp index b9eb49c2..7fcbce87 100644 --- a/LEGO1/lego/legoomni/src/race/legoracecar.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracecar.cpp @@ -7,8 +7,38 @@ #include "mxnotificationmanager.h" #include "mxutilities.h" +DECOMP_SIZE_ASSERT(EdgeReference, 0x08) 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 LegoRaceCar::LegoRaceCar() { @@ -42,9 +72,10 @@ void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed) m_maxLinearVel = p_worldSpeed; } LegoAnimActor::SetWorldSpeed(p_worldSpeed); - return; } - m_worldSpeed = p_worldSpeed; + else { + m_worldSpeed = p_worldSpeed; + } } // FUNCTION: LEGO1 0x10012ea0 @@ -86,9 +117,11 @@ void LegoRaceCar::ParseAction(char* p_extra) } // 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 - 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++) { g_edgeReferences[j].m_data = currentWorld->FindPathBoundary(g_edgeReferences[j].m_name);