From 96ef1e04e44b514ba249d04964586d456aa1f380 Mon Sep 17 00:00:00 2001 From: jonschz Date: Sun, 30 Jun 2024 14:00:33 +0200 Subject: [PATCH] Limited match on LegoRaceCar::ParseAction --- LEGO1/define.cpp | 4 ++ LEGO1/define.h | 1 + LEGO1/lego/legoomni/include/legorace.h | 3 +- LEGO1/lego/legoomni/include/legoraceactor.h | 2 +- LEGO1/lego/legoomni/include/legoracecar.h | 47 +++++++++++++++++--- LEGO1/lego/legoomni/src/race/legoracecar.cpp | 34 ++++++++++++-- 6 files changed, 79 insertions(+), 12 deletions(-) diff --git a/LEGO1/define.cpp b/LEGO1/define.cpp index 0c04bb50..4460107f 100644 --- a/LEGO1/define.cpp +++ b/LEGO1/define.cpp @@ -128,6 +128,10 @@ const char* g_strWORLD = "WORLD"; // STRING: LEGO1 0x10101ed0 const char* g_strANIMMAN_ID = "ANIMMAN_ID"; +// GLOBAL: LEGO1 0x101020d8 +// STRING: LEGO1 0x10101ec8 +const char* g_strCOMP = "COMP"; + // GLOBAL: LEGO1 0x101020e0 // STRING: LEGO1 0x10101eb0 const char* g_strBMP_ISMAP = "BMP_ISMAP"; diff --git a/LEGO1/define.h b/LEGO1/define.h index a73a80f8..1704d045 100644 --- a/LEGO1/define.h +++ b/LEGO1/define.h @@ -31,6 +31,7 @@ extern const char* g_strBOTTOM_TO_TOP; extern const char* g_strTOP_TO_BOTTOM; extern const char* g_strFILLER_INDEX; extern const char* g_strVARIABLE; +extern const char* g_strCOMP; extern const char* g_strBMP_ISMAP; extern const char* g_strAUTO_CREATE; extern const char* g_strDB_CREATE; diff --git a/LEGO1/lego/legoomni/include/legorace.h b/LEGO1/lego/legoomni/include/legorace.h index 388fa26a..3cb916af 100644 --- a/LEGO1/lego/legoomni/include/legorace.h +++ b/LEGO1/lego/legoomni/include/legorace.h @@ -4,6 +4,7 @@ #include "decomp.h" #include "legogamestate.h" #include "legostate.h" +#include "legoracemap.h" #include "legoworld.h" #include "mxrect32.h" #include "mxtypes.h" @@ -124,7 +125,7 @@ class LegoRace : public LegoWorld { virtual MxLong HandleType0Notification(MxNotificationParam&) { return 0; } // vtable+0x78 // STUB: LEGO1 0x1000dac0 - virtual void VTable0x7c(undefined4, undefined4) {} // vtable+0x7c + virtual void VTable0x7c(LegoRaceMap *, undefined4) {} // vtable+0x7c // SYNTHETIC: LEGO1 0x10015cc0 // LegoRace::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/legoraceactor.h b/LEGO1/lego/legoomni/include/legoraceactor.h index 46423f95..6d0d919d 100644 --- a/LEGO1/lego/legoomni/include/legoraceactor.h +++ b/LEGO1/lego/legoomni/include/legoraceactor.h @@ -36,7 +36,7 @@ class LegoRaceActor : public virtual LegoAnimActor { // SYNTHETIC: LEGO1 0x10014ac0 // LegoRaceActor::`scalar deleting destructor' -private: +protected: undefined4 m_unk0x08; // 0x08 }; diff --git a/LEGO1/lego/legoomni/include/legoracecar.h b/LEGO1/lego/legoomni/include/legoracecar.h index 632f52bb..09c2644b 100644 --- a/LEGO1/lego/legoomni/include/legoracecar.h +++ b/LEGO1/lego/legoomni/include/legoracecar.h @@ -4,6 +4,39 @@ #include "legocarraceactor.h" #include "legoracemap.h" +struct EdgeReference { + char* name; + LegoPathBoundary* 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 + } +}; + // VTABLE: LEGO1 0x100d58a0 LegoRaceActor // VTABLE: LEGO1 0x100d58a8 LegoAnimActor // VTABLE: LEGO1 0x100d58b8 LegoPathActor @@ -54,13 +87,13 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { // LegoRaceCar::`scalar deleting destructor' private: - undefined m_unk0x54; // 0x54 - undefined4 m_unk0x58; // 0x58 - Mx3DPointFloat m_unk0x5c; // 0x5c - undefined4 m_unk0x70; // 0x70 - undefined4 m_unk0x74; // 0x74 - undefined4 m_unk0x78; // 0x78 - undefined4 m_unk0x7c; // 0x7c + undefined m_unk0x54; // 0x54 + undefined4 m_unk0x58; // 0x58 + Mx3DPointFloat m_unk0x5c; // 0x5c + undefined4 m_unk0x70; // 0x70 + undefined4 m_unk0x74; // 0x74 + LegoPathBoundary* m_unk0x78; // 0x78 + LegoPathBoundary* m_unk0x7c; // 0x7c }; #endif // LEGORACECAR_H diff --git a/LEGO1/lego/legoomni/src/race/legoracecar.cpp b/LEGO1/lego/legoomni/src/race/legoracecar.cpp index 593d569f..3e1e8d5e 100644 --- a/LEGO1/lego/legoomni/src/race/legoracecar.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracecar.cpp @@ -1,7 +1,11 @@ #include "legoracecar.h" +#include "define.h" +#include "legorace.h" +#include "misc.h" #include "mxmisc.h" #include "mxnotificationmanager.h" +#include "mxutilities.h" DECOMP_SIZE_ASSERT(LegoRaceCar, 0x200) @@ -56,10 +60,34 @@ void LegoRaceCar::SetMaxLinearVelocity(float p_maxLinearVelocity) } } -// STUB: LEGO1 0x10012ef0 -void LegoRaceCar::ParseAction(char*) +// FUNCTION: LEGO1 0x10012ef0 +void LegoRaceCar::ParseAction(char* p_extra) { - // TODO + char local_100[256]; + LegoAnimActor::ParseAction(p_extra); + LegoRaceMap::ParseAction(p_extra); + LegoRace* current_world = (LegoRace*) CurrentWorld(); + if (KeyValueStringParse(local_100, g_strCOMP, p_extra) && current_world) { + current_world->VTable0x7c(this, atoi(local_100)); + } + if (!m_userNavFlag) { + for (MxU32 i = 0; i++;) { + undefined4 temp = LegoRaceActor::m_unk0x08; + if (LegoCarRaceActor::m_unk0x0c == FALSE + // || LegoCarRaceActor::m_unk0x10 <= i + ) { + break; + } + } + } + // STRING: LEGO1 0x100f0bc4 + m_unk0x78 = current_world->FindPathBoundary("EDG03_44"); + // STRING: LEGO1 0x100f0bb8 + m_unk0x7c = current_world->FindPathBoundary("EDG03_54"); + + for (MxS32 i = 0; i < sizeOfArray(g_edgeReferences); i++) { + g_edgeReferences[i].data = current_world->FindPathBoundary(g_edgeReferences[i].name); + } } // STUB: LEGO1 0x10012ff0