From afa459a97b92f0a97e69df767c42676f6f822aac Mon Sep 17 00:00:00 2001 From: jonschz Date: Thu, 14 Nov 2024 18:10:37 +0100 Subject: [PATCH] Clean up FUN_10012de0 --- LEGO1/lego/legoomni/include/legoracers.h | 4 +++ LEGO1/lego/legoomni/include/legoracespecial.h | 5 ---- LEGO1/lego/legoomni/src/race/jetskirace.cpp | 6 ++--- LEGO1/lego/legoomni/src/race/legoracers.cpp | 23 ++++++++++++++++ .../legoomni/src/race/legoracespecial.cpp | 27 ------------------- 5 files changed, 30 insertions(+), 35 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoracers.h b/LEGO1/lego/legoomni/include/legoracers.h index b16328d7..add7d795 100644 --- a/LEGO1/lego/legoomni/include/legoracers.h +++ b/LEGO1/lego/legoomni/include/legoracers.h @@ -75,6 +75,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { virtual void FUN_10012ff0(float p_param); virtual MxU32 HandleSkeletonKicks(float p_param1); + static void FUN_10012de0(); static void FUN_10013670(); // SYNTHETIC: LEGO1 0x10014240 @@ -111,6 +112,9 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { static MxU32 g_emptySoundKeyListIndex; static MxU32 g_srtrhIndex; static Mx3DPointFloat g_unk0x10102af0; + static MxLong g_timeLastSoundPlayed; + static MxS32 g_unk0x100f0b88; + static MxBool g_unk0x100f0b8c; }; #endif // LEGORACERS_H diff --git a/LEGO1/lego/legoomni/include/legoracespecial.h b/LEGO1/lego/legoomni/include/legoracespecial.h index 8ec92c93..76245493 100644 --- a/LEGO1/lego/legoomni/include/legoracespecial.h +++ b/LEGO1/lego/legoomni/include/legoracespecial.h @@ -66,8 +66,6 @@ class LegoCarRaceActor : public virtual LegoRaceActor { virtual MxS32 VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edge); // vtable+0x1c - static void FUN_10012de0(); - // SYNTHETIC: LEGO1 0x10012c30 // LegoCarRaceActor::`vbase destructor' @@ -93,9 +91,6 @@ class LegoCarRaceActor : public virtual LegoRaceActor { MxFloat m_unk0x1c; // 0x1c static MxFloat g_unk0x100f7aec; - static MxLong g_timeLastSoundPlayed; - static MxS32 g_unk0x100f0b88; - static MxBool g_unk0x100f0b8c; }; // GLOBAL: LEGO1 0x100da0b0 diff --git a/LEGO1/lego/legoomni/src/race/jetskirace.cpp b/LEGO1/lego/legoomni/src/race/jetskirace.cpp index bcb35b6b..c796d4e7 100644 --- a/LEGO1/lego/legoomni/src/race/jetskirace.cpp +++ b/LEGO1/lego/legoomni/src/race/jetskirace.cpp @@ -130,7 +130,7 @@ MxLong JetskiRace::HandleClick(LegoEventNotificationParam& p_param) m_act1State->m_unk0x018 = 0; VariableTable()->SetVariable(g_raceState, ""); VariableTable()->SetVariable(g_strHIT_WALL_SOUND, ""); - LegoCarRaceActor::FUN_10012de0(); + LegoRaceCar::FUN_10012de0(); m_destLocation = LegoGameState::e_jetraceExterior; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); return 0; @@ -138,7 +138,7 @@ MxLong JetskiRace::HandleClick(LegoEventNotificationParam& p_param) m_act1State->m_unk0x018 = 0; VariableTable()->SetVariable(g_raceState, ""); VariableTable()->SetVariable(g_strHIT_WALL_SOUND, ""); - LegoCarRaceActor::FUN_10012de0(); + LegoRaceCar::FUN_10012de0(); m_destLocation = LegoGameState::e_infomain; result = 1; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); @@ -165,6 +165,6 @@ MxBool JetskiRace::Escape() VariableTable()->SetVariable(g_raceState, ""); VariableTable()->SetVariable(g_strHIT_WALL_SOUND, ""); m_destLocation = LegoGameState::e_infomain; - LegoCarRaceActor::FUN_10012de0(); + LegoRaceCar::FUN_10012de0(); return TRUE; } diff --git a/LEGO1/lego/legoomni/src/race/legoracers.cpp b/LEGO1/lego/legoomni/src/race/legoracers.cpp index 62346548..0cf61828 100644 --- a/LEGO1/lego/legoomni/src/race/legoracers.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracers.cpp @@ -130,6 +130,21 @@ MxU32 LegoRaceCar::g_emptySoundKeyListIndex = 0; // GLOBAL: BETA10 0x101f5f8c MxU32 LegoRaceCar::g_srtrhIndex = 0; +// GLOBAL: LEGO1 0x100f0b84 +// GLOBAL: BETA10 0x101f5f90 +MxLong LegoRaceCar::g_timeLastSoundPlayed = 0; + +// GLOBAL: LEGO1 0x100f0b88 +// GLOBAL: BETA10 0x101f5f94 +MxS32 LegoRaceCar::g_unk0x100f0b88 = 0; + +// GLOBAL: LEGO1 0x100f0b8c +// GLOBAL: BETA10 0x101f5f98 +MxBool LegoRaceCar::g_unk0x100f0b8c = TRUE; + +// GLOBAL: LEGO1 0x100f7aec +MxFloat LegoRaceCar::g_unk0x100f7aec = 8.0f; + // Initialized at LEGO1 0x10012db0 // GLOBAL: LEGO1 0x10102af0 // GLOBAL: BETA10 0x102114c0 @@ -160,6 +175,14 @@ MxLong LegoRaceCar::Notify(MxParam& p_param) return LegoRaceMap::Notify(p_param); } +// FUNCTION: LEGO1 0x10012de0 +void LegoRaceCar::FUN_10012de0() +{ + g_unk0x100f0b8c = TRUE; + g_timeLastSoundPlayed = 0; + g_unk0x100f0b88 = 0; +} + // FUNCTION: LEGO1 0x10012e60 // FUNCTION: BETA10 0x100cb191 void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed) diff --git a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp index c8848406..082aff2a 100644 --- a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp @@ -12,18 +12,6 @@ // File name verified by BETA10 0x100cedf7 - -// FUNCTION: LEGO1 0x10012de0 -void LegoCarRaceActor::FUN_10012de0() -{ - // This function is probably in the wrong place. - // According to the address it should be in legoracespecial.h. - // However, if we put it there, it gets inlined instead of called. - g_unk0x100f0b8c = TRUE; - g_timeLastSoundPlayed = 0; - g_unk0x100f0b88 = 0; -} - DECOMP_SIZE_ASSERT(LegoCarRaceActor, 0x1a0) // GLOBAL: LEGO1 0x100f0c68 @@ -38,21 +26,6 @@ const char* g_fuel = "FUEL"; // STRING: LEGO1 0x100f0c54 const char* g_racing = "RACING"; -// GLOBAL: LEGO1 0x100f0b84 -// GLOBAL: BETA10 0x101f5f90 -MxLong LegoCarRaceActor::g_timeLastSoundPlayed = 0; - -// GLOBAL: LEGO1 0x100f0b88 -// GLOBAL: BETA10 0x101f5f94 -MxS32 LegoCarRaceActor::g_unk0x100f0b88 = 0; - -// GLOBAL: LEGO1 0x100f0b8c -// GLOBAL: BETA10 0x101f5f98 -MxBool LegoCarRaceActor::g_unk0x100f0b8c = TRUE; - -// GLOBAL: LEGO1 0x100f7aec -MxFloat LegoCarRaceActor::g_unk0x100f7aec = 8.0f; - // FUNCTION: LEGO1 0x10080350 // FUNCTION: BETA10 0x100cd6b0 LegoCarRaceActor::LegoCarRaceActor()