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 <mail@csemmler.com>
This commit is contained in:
Sebastian Mischke 2026-01-10 19:49:04 +01:00 committed by GitHub
parent 923b450008
commit da69997480
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 31 deletions

View File

@ -26,7 +26,7 @@ class LegoRaceMap : public virtual LegoRaceActor {
void Animate(float p_time) override = 0; // vtable+0x70 void Animate(float p_time) override = 0; // vtable+0x70
// LegoRaceMap vtable // LegoRaceMap vtable
virtual void FUN_1005d4b0(); // vtable+0x00 virtual void UpdateMapLocatorPosition(); // vtable+0x00
// SYNTHETIC: LEGO1 0x10012c50 // SYNTHETIC: LEGO1 0x10012c50
// LegoRaceMap::`vbase destructor' // LegoRaceMap::`vbase destructor'
@ -35,28 +35,28 @@ class LegoRaceMap : public virtual LegoRaceActor {
// LegoRaceMap::`scalar deleting destructor' // LegoRaceMap::`scalar deleting destructor'
private: private:
MxBool m_unk0x08; // 0x08 MxBool m_mapEnabled; // 0x08
MxStillPresenter* m_stillPresenter; // 0x0c MxStillPresenter* m_stillPresenter; // 0x0c
// variable name verified by BETA10 0x100ca82b // variable name verified by BETA10 0x100ca82b
MxControlPresenter* m_Map_Ctl; // 0x10 MxControlPresenter* m_Map_Ctl; // 0x10
// likely an x-offset of the race map in world space // 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) // inversely scales the map in x direction (either convert world->screen space or to control the size)
float m_unk0x18; // 0x18 float m_worldXScale; // 0x18
// likely a y-offset of the race map in world space // likely a z-offset of the race map in world space
float m_unk0x1c; // 0x1c float m_worldZOffset; // 0x1c
// inversely scales the map in y direction (either convert world->screen space or to control the size) // inversely scales the map in z direction (either convert world->screen space or to control the size)
float m_unk0x20; // 0x20 float m_worldZScale; // 0x20
// scales the map in x direction (either convert world->screen space or to change the size) // 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) // 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 // 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 // likely a y-offset of the race map in screen space
float m_unk0x30; // 0x30 float m_screenYOffset; // 0x30
}; };
// GLOBAL: LEGO1 0x100d8848 // GLOBAL: LEGO1 0x100d8848

View File

@ -15,7 +15,7 @@ DECOMP_SIZE_ASSERT(LegoRaceMap, 0x1b4)
// FUNCTION: BETA10 0x100ca2c0 // FUNCTION: BETA10 0x100ca2c0
LegoRaceMap::LegoRaceMap() LegoRaceMap::LegoRaceMap()
{ {
m_unk0x08 = FALSE; m_mapEnabled = FALSE;
m_stillPresenter = NULL; m_stillPresenter = NULL;
m_Map_Ctl = 0; m_Map_Ctl = 0;
ControlManager()->Register(this); ControlManager()->Register(this);
@ -54,42 +54,42 @@ void LegoRaceMap::ParseAction(char* p_extra)
if (KeyValueStringParse(value, g_mapGeometry, p_extra)) { if (KeyValueStringParse(value, g_mapGeometry, p_extra)) {
char* token = strtok(value, g_parseExtraTokens); char* token = strtok(value, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x14 = atof(token); m_worldXOffset = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x18 = atof(token); m_worldXScale = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x1c = atof(token); m_worldZOffset = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x20 = atof(token); m_worldZScale = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x24 = atof(token); m_screenXScale = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x28 = atof(token); m_screenYScale = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { if (token != NULL) {
m_unk0x2c = atof(token); m_screenXOffset = atof(token);
} }
token = strtok(NULL, g_parseExtraTokens); token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) { 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: LEGO1 0x1005d4b0
// FUNCTION: BETA10 0x100ca849 // FUNCTION: BETA10 0x100ca849
void LegoRaceMap::FUN_1005d4b0() void LegoRaceMap::UpdateMapLocatorPosition()
{ {
if (m_unk0x08) { if (m_mapEnabled) {
short xPos = (GetWorldPosition()[0] - m_unk0x14) / m_unk0x18 * m_unk0x24; short xPos = (GetWorldPosition()[0] - m_worldXOffset) / m_worldXScale * m_screenXScale;
short yPos = (GetWorldPosition()[2] - m_unk0x1c) / m_unk0x20 * m_unk0x28; 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) { m_Map_Ctl->GetAction()->GetObjectId() == ((LegoControlManagerNotificationParam&) p_param).m_clickedObjectId) {
if (((LegoControlManagerNotificationParam&) p_param).m_enabledChild == 1) { if (((LegoControlManagerNotificationParam&) p_param).m_enabledChild == 1) {
m_unk0x08 = TRUE; m_mapEnabled = TRUE;
FUN_1005d4b0(); UpdateMapLocatorPosition();
m_stillPresenter->Enable(TRUE); m_stillPresenter->Enable(TRUE);
} }
else { else {
m_unk0x08 = FALSE; m_mapEnabled = FALSE;
m_stillPresenter->Enable(FALSE); m_stillPresenter->Enable(FALSE);
} }
} }

View File

@ -411,7 +411,7 @@ void LegoRaceCar::Animate(float p_time)
} }
if (LegoCarRaceActor::m_animState == 1) { if (LegoCarRaceActor::m_animState == 1) {
FUN_1005d4b0(); UpdateMapLocatorPosition();
if (!m_userNavFlag) { if (!m_userNavFlag) {
FUN_10080590(p_time); FUN_10080590(p_time);
@ -610,7 +610,7 @@ void LegoJetski::Animate(float p_time)
LegoJetskiRaceActor::Animate(p_time); LegoJetskiRaceActor::Animate(p_time);
if (LegoCarRaceActor::m_animState == 1) { if (LegoCarRaceActor::m_animState == 1) {
FUN_1005d4b0(); UpdateMapLocatorPosition();
if (!m_userNavFlag) { if (!m_userNavFlag) {
FUN_10080590(p_time); FUN_10080590(p_time);