From da699974802c53007db89beac91c8a3258600546 Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Sat, 10 Jan 2026 19:49:04 +0100 Subject: [PATCH] Clear unknowns in `LegoRaceMap` (#1705) * Rename FUN_1005d4b0 to UpdateMapLocatorPosition * Rename m_unk0x08 to m_mapEnabled * Rename m_unk0x14 to m_worldXOffset * Rename m_unk0x1c to m_worldYOffset * Rename m_unk0x18 to m_worldXScale * Rename m_unk0x20 to m_worldYScale * Rename m_unk0x24 to m_screenXScale * Rename m_unk0x28 to m_screenYScale * Rename m_unk0x2c to m_screenXOffset * Rename m_unk0x30 to m_screenYOffset * Rename worldY to worldZ --------- Co-authored-by: Christian Semmler --- LEGO1/lego/legoomni/include/legoracemap.h | 24 +++++++------- LEGO1/lego/legoomni/src/race/legoracemap.cpp | 34 ++++++++++---------- LEGO1/lego/legoomni/src/race/legoracers.cpp | 4 +-- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoracemap.h b/LEGO1/lego/legoomni/include/legoracemap.h index 562581fa..448f11fa 100644 --- a/LEGO1/lego/legoomni/include/legoracemap.h +++ b/LEGO1/lego/legoomni/include/legoracemap.h @@ -26,7 +26,7 @@ class LegoRaceMap : public virtual LegoRaceActor { void Animate(float p_time) override = 0; // vtable+0x70 // LegoRaceMap vtable - virtual void FUN_1005d4b0(); // vtable+0x00 + virtual void UpdateMapLocatorPosition(); // vtable+0x00 // SYNTHETIC: LEGO1 0x10012c50 // LegoRaceMap::`vbase destructor' @@ -35,28 +35,28 @@ class LegoRaceMap : public virtual LegoRaceActor { // LegoRaceMap::`scalar deleting destructor' private: - MxBool m_unk0x08; // 0x08 + MxBool m_mapEnabled; // 0x08 MxStillPresenter* m_stillPresenter; // 0x0c // variable name verified by BETA10 0x100ca82b MxControlPresenter* m_Map_Ctl; // 0x10 // likely an x-offset of the race map in world space - float m_unk0x14; // 0x14 + float m_worldXOffset; // 0x14 // inversely scales the map in x direction (either convert world->screen space or to control the size) - float m_unk0x18; // 0x18 - // likely a y-offset of the race map in world space - float m_unk0x1c; // 0x1c - // inversely scales the map in y direction (either convert world->screen space or to control the size) - float m_unk0x20; // 0x20 + float m_worldXScale; // 0x18 + // likely a z-offset of the race map in world space + float m_worldZOffset; // 0x1c + // inversely scales the map in z direction (either convert world->screen space or to control the size) + float m_worldZScale; // 0x20 // scales the map in x direction (either convert world->screen space or to change the size) - float m_unk0x24; // 0x24 + float m_screenXScale; // 0x24 // scales the map in y direction (either convert world->screen space or to change the size) - float m_unk0x28; // 0x28 + float m_screenYScale; // 0x28 // likely an x-offset of the race map in screen space - float m_unk0x2c; // 0x2c + float m_screenXOffset; // 0x2c // likely a y-offset of the race map in screen space - float m_unk0x30; // 0x30 + float m_screenYOffset; // 0x30 }; // GLOBAL: LEGO1 0x100d8848 diff --git a/LEGO1/lego/legoomni/src/race/legoracemap.cpp b/LEGO1/lego/legoomni/src/race/legoracemap.cpp index 9637114d..cbc1cbb2 100644 --- a/LEGO1/lego/legoomni/src/race/legoracemap.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracemap.cpp @@ -15,7 +15,7 @@ DECOMP_SIZE_ASSERT(LegoRaceMap, 0x1b4) // FUNCTION: BETA10 0x100ca2c0 LegoRaceMap::LegoRaceMap() { - m_unk0x08 = FALSE; + m_mapEnabled = FALSE; m_stillPresenter = NULL; m_Map_Ctl = 0; ControlManager()->Register(this); @@ -54,42 +54,42 @@ void LegoRaceMap::ParseAction(char* p_extra) if (KeyValueStringParse(value, g_mapGeometry, p_extra)) { char* token = strtok(value, g_parseExtraTokens); if (token != NULL) { - m_unk0x14 = atof(token); + m_worldXOffset = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x18 = atof(token); + m_worldXScale = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x1c = atof(token); + m_worldZOffset = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x20 = atof(token); + m_worldZScale = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x24 = atof(token); + m_screenXScale = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x28 = atof(token); + m_screenYScale = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x2c = atof(token); + m_screenXOffset = atof(token); } token = strtok(NULL, g_parseExtraTokens); if (token != NULL) { - m_unk0x30 = atof(token); + m_screenYOffset = atof(token); } } @@ -106,13 +106,13 @@ void LegoRaceMap::ParseAction(char* p_extra) // FUNCTION: LEGO1 0x1005d4b0 // FUNCTION: BETA10 0x100ca849 -void LegoRaceMap::FUN_1005d4b0() +void LegoRaceMap::UpdateMapLocatorPosition() { - if (m_unk0x08) { - short xPos = (GetWorldPosition()[0] - m_unk0x14) / m_unk0x18 * m_unk0x24; - short yPos = (GetWorldPosition()[2] - m_unk0x1c) / m_unk0x20 * m_unk0x28; + if (m_mapEnabled) { + short xPos = (GetWorldPosition()[0] - m_worldXOffset) / m_worldXScale * m_screenXScale; + short yPos = (GetWorldPosition()[2] - m_worldZOffset) / m_worldZScale * m_screenYScale; - m_stillPresenter->SetPosition(xPos + m_unk0x2c, m_unk0x30 - yPos); + m_stillPresenter->SetPosition(xPos + m_screenXOffset, m_screenYOffset - yPos); } } @@ -130,12 +130,12 @@ MxLong LegoRaceMap::Notify(MxParam& p_param) m_Map_Ctl->GetAction()->GetObjectId() == ((LegoControlManagerNotificationParam&) p_param).m_clickedObjectId) { if (((LegoControlManagerNotificationParam&) p_param).m_enabledChild == 1) { - m_unk0x08 = TRUE; - FUN_1005d4b0(); + m_mapEnabled = TRUE; + UpdateMapLocatorPosition(); m_stillPresenter->Enable(TRUE); } else { - m_unk0x08 = FALSE; + m_mapEnabled = FALSE; m_stillPresenter->Enable(FALSE); } } diff --git a/LEGO1/lego/legoomni/src/race/legoracers.cpp b/LEGO1/lego/legoomni/src/race/legoracers.cpp index 8b1142f9..d338c861 100644 --- a/LEGO1/lego/legoomni/src/race/legoracers.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracers.cpp @@ -411,7 +411,7 @@ void LegoRaceCar::Animate(float p_time) } if (LegoCarRaceActor::m_animState == 1) { - FUN_1005d4b0(); + UpdateMapLocatorPosition(); if (!m_userNavFlag) { FUN_10080590(p_time); @@ -610,7 +610,7 @@ void LegoJetski::Animate(float p_time) LegoJetskiRaceActor::Animate(p_time); if (LegoCarRaceActor::m_animState == 1) { - FUN_1005d4b0(); + UpdateMapLocatorPosition(); if (!m_userNavFlag) { FUN_10080590(p_time);