This commit is contained in:
Sebastian Mischke 2026-01-08 00:43:18 +01:00 committed by GitHub
commit e073f5e5cc
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
// 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

View File

@ -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);
}
}

View File

@ -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);