diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2025-05-23 16:53:14 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-23 16:53:14 -0600 |
| commit | 2a0c0939c780babc45c8c22dfd6f94563485bae5 (patch) | |
| tree | 0a8f7d6a5a99452645260d53e778204327275deb /src/code_80057C60.c | |
| parent | 9363e3d77631b1028a765c075a00293bd20c9ba7 (diff) | |
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>
Diffstat (limited to 'src/code_80057C60.c')
| -rw-r--r-- | src/code_80057C60.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 50622a10a..2ce053cac 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -778,7 +778,7 @@ void render_object_for_player(s32 cameraId) { } void render_snowing_effect(s32 playerId) { - if (GetCourse() == GetFrappeSnowland()) { + if (IsFrappeSnowland()) { if (gGamestate != 9) { if ((D_8015F894 == 0) && (gPlayerCountSelection1 == 1)) { render_object_snowflakes_particles(); @@ -1563,7 +1563,7 @@ void func_8005A3C0(void) { } void func_8005A71C(void) { - // if (GetCourse() == GetBowsersCastle()) { + // if (IsBowsersCastle()) { // func_80081210(); //} } @@ -1644,7 +1644,7 @@ void update_object(void) { // func_80074EE8(); // Grand prix balloons //} func_80076F2C(); - if ((s16) GetCourse() != GetFrappeSnowland()) { + if (!IsFrappeSnowland()) { update_leaf(); } } @@ -2596,7 +2596,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) { case 1: /* switch 1 */ CM_ActivateSecondLapLakitu(playerId); // func_80079084(playerId); func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15)); - if ((GetCourse() == GetLuigiRaceway()) && (D_80165898 == 0) && + if ((IsLuigiRaceway()) && (D_80165898 == 0) && (gModeSelection != (s32) TIME_TRIALS)) { D_80165898 = 1; } @@ -2618,7 +2618,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) { if (D_8018D114 == 2) { D_80165800[playerId] = 0; } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { playerHUD[playerId].unk_81 = 1; } playerHUD[playerId].lap1CompletionTimeX = 0x0140; @@ -2935,22 +2935,22 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, (s8) var_t3); func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[10 + arg1], 10, 0, 0x0080); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[10 + arg1], 11, 0, 0x0080); } player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); @@ -2959,22 +2959,22 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, (s8) var_t3); func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[10 + arg1], 10, 0, 0x0080); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[10 + arg1], 11, 0, 0x0080); } player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); @@ -3201,44 +3201,44 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t3); func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[10 + arg1], 10, 0, 0x0080); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[10 + arg1], 11, 0, 0x0080); } player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); } else if (player->unk_258[10 + arg2].unk_01E > 0) { func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t3); func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[10 + arg1], 0x000A, 0, 0x0080); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[10 + arg1], 0x000B, 0, 0x0080); } player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); @@ -3402,44 +3402,44 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[10 + arg1], 0x000A, 0, 0x0080); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[10 + arg1], 0x000B, 0, 0x0080); } player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); } else if (player->unk_258[10 + arg2].unk_01E > 0) { func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[10 + arg1], 0x000A, 0, 0x0080); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[10 + arg1], 0x000B, 0, 0x0080); } player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); @@ -3638,13 +3638,13 @@ void func_800608E0(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8 var_f0 = 0.0f; } sp4C = (D_801652A0[arg3] - player->pos[1]) - 3.0f; - if ((player->unk_0DE & 1) && (GetCourse() != GetKoopaTroopaBeach())) { + if ((player->unk_0DE & 1) && (!IsKoopaTroopaBeach())) { var_f0 = 2.5f; sp4C = (f32) ((f64) (D_801652A0[arg3] - player->pos[1]) + 0.1); } func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); func_8005D7D8(&player->unk_258[arg1], 3, var_f0); - if ((GetCourse() == GetBowsersCastle()) || (GetCourse() == GetBigDonut())) { + if ((IsBowsersCastle()) || (IsBigDonut())) { func_8005D800(&player->unk_258[arg1], 0, 0x00AF); } else { func_8005D800(&player->unk_258[arg1], 0x00FFFFFF, 0x00CF); @@ -3658,7 +3658,7 @@ void func_800608E0(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8 } void func_80060B14(Player* player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - if ((GetCourse() != GetSkyscraper()) && (GetCourse() != GetRainbowRoad())) { + if ((!IsSkyscraper()) && (!IsRainbowRoad())) { if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg2].unk_01C == 0))) { func_800608E0(player, arg1, arg2, arg3, arg4); } else if (player->unk_258[arg2].unk_01E > 0) { @@ -3674,10 +3674,10 @@ void func_80060BCC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 f32 sp48; f32 sp44; - if (GetCourse() == GetSkyscraper()) { + if (IsSkyscraper()) { return; } - if (GetCourse() == GetRainbowRoad()) { + if (IsRainbowRoad()) { return; } sp54 = random_int(0x0168U) - 0xB4; @@ -3712,7 +3712,7 @@ void func_80060F50(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8 func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, 0, 0); func_8005D7D8(&player->unk_258[arg1], 5, 4.0f); - if ((GetCourse() == GetBowsersCastle()) || (GetCourse() == GetBigDonut())) { + if ((IsBowsersCastle()) || (IsBigDonut())) { func_8005D800(&player->unk_258[arg1], 0xFF0000, 0xFF); } else { func_8005D800(&player->unk_258[arg1], 0xFFFFFF, 0xFF); @@ -4058,22 +4058,22 @@ void func_800624D8(Player* player, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s8 a switch (player->surfaceType) { case DIRT: for (var_s1 = 0; var_s1 < 10; var_s1++) { - if ((GetCourse() == GetChocoMountain()) || (GetCourse() == GetRoyalRaceway())) { + if ((IsChocoMountain()) || (IsRoyalRaceway())) { func_8005DAD8(&player->unk_258[0x1E + var_s1], 1, 0, 0x00A8); } - if (GetCourse() == GetKalimariDesert()) { + if (IsKalimariDesert()) { func_8005DAD8(&player->unk_258[0x1E + var_s1], 7, 0, 0x00A8); } - if (GetCourse() == GetMooMooFarm()) { + if (IsMooMooFarm()) { func_8005DAD8(&player->unk_258[0x1E + var_s1], 8, 0, 0x00A8); } - if (GetCourse() == GetWarioStadium()) { + if (IsWarioStadium()) { func_8005DAD8(&player->unk_258[0x1E + var_s1], 9, 0, 0x00A8); } - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { func_8005DAD8(&player->unk_258[0x1E + var_s1], 0x000A, 0, 0x00A8); } - if (GetCourse() == GetDkJungle()) { + if (IsDkJungle()) { func_8005DAD8(&player->unk_258[0x1E + var_s1], 0x000B, 0, 0x00A8); } func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); @@ -4628,7 +4628,7 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { f32 sp3C; sp40 = D_801652A0[arg2] - player->pos[1] - 3.0f; - if (((player->unk_0DE & 1) != 0) && (GetCourse() != GetKoopaTroopaBeach())) { + if (((player->unk_0DE & 1) != 0) && (!IsKoopaTroopaBeach())) { sp40 = D_801652A0[arg2] - player->pos[1] + 0.1; } |
