Implement CarRace (#1165)

* Implement `CarRace`

* Improve `CarRace::Create`

* Fix arrays

* Clean up array

* Fix CI errors

* Implement `LegoRaceCar::FUN_10012e00()`

* Implement `Doors::VTable0xcc`

* Address review comments, part 1

* Address review comments, part 2

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2024-11-23 20:33:15 +01:00
committed by GitHub
parent e56ac9ab55
commit 0aa5e010ae
21 changed files with 533 additions and 61 deletions

View File

@@ -180,6 +180,18 @@ void LegoRaceCar::FUN_10012de0()
g_unk0x100f0b88 = 0;
}
// FUNCTION: LEGO1 0x10012e00
// FUNCTION: BETA10 0x100cb129
void LegoRaceCar::FUN_10012e00()
{
// Note the (likely unintentional) order of operations: `%` is executed before `/`,
// so the division is performed at runtime.
g_srtsl18to29Index = rand() % sizeof(g_srtsl18to29) / sizeof(g_srtsl18to29[0]);
g_srtsl6to10Index = rand() % sizeof(g_srtsl6to10) / sizeof(g_srtsl6to10[0]);
g_emptySoundKeyListIndex = rand() % sizeof(g_emptySoundKeyList) / sizeof(g_emptySoundKeyList[0]);
g_srtrhIndex = rand() % sizeof(g_srtrh) / sizeof(g_srtrh[0]);
}
// FUNCTION: LEGO1 0x10012e60
// FUNCTION: BETA10 0x100cb191
void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed)