Refactor World::Courses to unique_ptr (#211)

* wip course unique ptr

* Track unique_ptr : This probably compiles

* Finish impl Courses as unique_ptr

* Fix error

* Fixes

* More fixes

* Cleanup

* Remove old vars

---------

Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
This commit is contained in:
MegaMech
2025-05-23 16:53:14 -06:00
committed by GitHub
parent 9363e3d776
commit 2a0c0939c7
34 changed files with 403 additions and 473 deletions
+12 -10
View File
@@ -2647,11 +2647,11 @@ void func_800C847C(u8 playerId) {
func_800C97C4(playerId);
D_800E9F74[playerId] = 1;
func_800C94A4(playerId);
if (((GetCourse() == GetChocoMountain()) || (GetCourse() == GetBowsersCastle()) ||
(GetCourse() == GetBansheeBoardwalk()) || (GetCourse() == GetYoshiValley()) ||
(GetCourse() == GetFrappeSnowland()) || (GetCourse() == GetKoopaTroopaBeach()) ||
(GetCourse() == GetRoyalRaceway()) || (GetCourse() == GetSherbetLand()) ||
(GetCourse() == GetDkJungle()) || (GetCourse() == GetBigDonut())) &&
if (((IsChocoMountain()) || (IsBowsersCastle()) ||
(IsBansheeBoardwalk()) || (IsYoshiValley()) ||
(IsFrappeSnowland()) || (IsKoopaTroopaBeach()) ||
(IsRoyalRaceway()) || (IsSherbetLand()) ||
(IsDkJungle()) || (IsBigDonut())) &&
(D_800EA0EC[playerId] == 0)) {
play_sound((gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05),
&D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4,
@@ -2664,7 +2664,7 @@ void func_800C847C(u8 playerId) {
D_800E9F74[playerId] = 2;
func_800C94A4(playerId);
D_800E9F74[playerId] = 0;
if ((GetCourse() == GetKoopaTroopaBeach()) && (D_800EA0EC[playerId] == 0)) {
if ((IsKoopaTroopaBeach()) && (D_800EA0EC[playerId] == 0)) {
play_sound((gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08),
&D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4,
(u8*) &D_800E9F7C[playerId].unk_14);
@@ -2746,7 +2746,7 @@ void func_800C89E4(void) {
}
void func_800C8AE4(void) {
if (GetCourse() == GetLuigiRaceway()) {
if (IsLuigiRaceway()) {
if (D_800EA184 != 0) {
if ((u8) D_800EA16C == 0) {
// Has to be this way, can't be D_800EA184++
@@ -2824,11 +2824,11 @@ void func_800C8CCC() {
}
void play_sound2(s32 soundBits) {
if ((soundBits == SOUND_ACTION_REV_ENGINE) && (GetCourse() == GetDkJungle())) {
if ((soundBits == SOUND_ACTION_REV_ENGINE) && (IsDkJungle())) {
soundBits = SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x27);
}
if ((soundBits == SOUND_ACTION_REV_ENGINE_2) && (GetCourse() == GetDkJungle())) {
if ((soundBits == SOUND_ACTION_REV_ENGINE_2) && (IsDkJungle())) {
soundBits = SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x28);
}
play_sound(soundBits, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
@@ -3467,7 +3467,9 @@ void func_800CAEC4(u8 playerId, f32 arg1) {
arg1 = 0.0f;
}
D_800EA120[playerId] = arg1;
play_sound(gCurrentCourseId + 0x19007020, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4,
//! @warning this used to be gCurrentCourseId + 0x19007020
// This may not be equivallent.
play_sound(GetCourseIndex() + 0x19007020, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4,
&D_800EA120[playerId], (u8*) &D_800E9F7C[playerId].unk_14);
break;
default: