diff --git a/include/config.h b/include/config.h index 6db8ed4d6..85d1a89eb 100644 --- a/include/config.h +++ b/include/config.h @@ -4,8 +4,8 @@ /** * @brief Use a custom course engine * Use a custom course engine instead of the default one who use switch. see course.h and everywhere - * USE_CUSTOM_COURSE_ENGINE are use to define your + * ENABLE_CUSTOM_COURSE_ENGINE are use to define your * */ -#define USE_CUSTOM_COURSE_ENGINE 0 +#define ENABLE_CUSTOM_COURSE_ENGINE 0 #endif diff --git a/include/course.h b/include/course.h index c1546a29f..ff99e5933 100644 --- a/include/course.h +++ b/include/course.h @@ -26,7 +26,7 @@ struct _struct_gCoursePathSizes_0x10 { /* 0x0A */ char padA[6]; }; // size 0x10 -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE typedef enum { /* 0x00 */ COURSE_MARIO_RACEWAY = 0, /* 0x01 */ COURSE_CHOCO_MOUNTAIN, @@ -79,7 +79,7 @@ typedef enum { #endif -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE extern s16 gCurrentCourseId; extern s16* D_800DCBB4[]; #define GET_COURSE_800DCBB4(n) D_800DCBB4[gCurrentCourseId][n] diff --git a/src/code_800029B0.c b/src/code_800029B0.c index d6460ea57..34ca227df 100644 --- a/src/code_800029B0.c +++ b/src/code_800029B0.c @@ -26,7 +26,7 @@ extern s32 D_802BA038; extern s16 D_802BA048; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE s16 gCurrentCourseId = 0; #endif s16 gCurrentlyLoadedCourseId = 0xFF; @@ -245,7 +245,7 @@ void setup_race(void) { // sound related void func_80002DAC(void) { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: vec3f_set(D_8015F748, -223.0f, 94.0f, -155.0f); @@ -309,7 +309,7 @@ void func_80003040(void) { gPlayerCountSelection1 = 1; set_segment_base_addr(0x3, (void*) (gNextFreeMemoryAddress + 0xFFFF7000)); destroy_all_actors(); -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: dma_textures(gTextureTrees1, 0x35B, 0x800); diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index b635907d5..648a079f6 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -1538,7 +1538,7 @@ void update_vehicles(void) { func_8000DF8C(i); } } -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_KALAMARI_DESERT: update_vehicle_trains(); @@ -3467,7 +3467,7 @@ void func_8000F2DC(void) { } D_80164430 = *gWaypointCountByPathIndex; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_KALAMARI_DESERT: generate_train_waypoints(); @@ -4412,7 +4412,7 @@ void spawn_course_vehicles(void) { f32 origXPos; f32 origZPos; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_KALAMARI_DESERT: for (loopIndex = 0; loopIndex < NUM_TRAINS; loopIndex++) { diff --git a/src/code_8003DC40.c b/src/code_8003DC40.c index 58c3b0a0f..b97838b71 100644 --- a/src/code_8003DC40.c +++ b/src/code_8003DC40.c @@ -233,7 +233,7 @@ void func_8003F46C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 player->kartHopVelocity = 0.0f; return; } else { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: func_8003E048(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7); diff --git a/src/code_80057C60.c b/src/code_80057C60.c index a4385ee1e..4a0134e08 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -692,7 +692,7 @@ void render_player_snow_effect_four(void) { } void render_object_for_player(s32 cameraId) { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: break; @@ -1570,7 +1570,7 @@ void func_8005A71C(void) { } void update_object(void) { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: case COURSE_CHOCO_MOUNTAIN: diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index 164dd9b4f..3ee13e5d6 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -183,7 +183,7 @@ void course_mini_map_settings(void) { if (gCurrentCourseId < NUM_COURSES - 1) { func_8006EEE8((s32) gCurrentCourseId); } -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: D_8018D220 = (void*) dma_textures(gTextureExhaust5, 0x443, 0x1000); @@ -691,7 +691,7 @@ void course_init_cloud(void) { s32 var_s0; s32 var_s4; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: // Uses Kalimari Desert's clouds for initialization? @@ -763,7 +763,7 @@ void init_course_objects(void) { s32 objectId; s32 i; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: if (gGamestate != 9) { diff --git a/src/code_80091750.c b/src/code_80091750.c index f90eb325e..3da095763 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -315,7 +315,7 @@ char* gCupNames[] = { "special cup", }; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE // Displays at beginning of course char* gCourseNames[] = { #include "assets/course_metadata/gCourseNames.inc.c" @@ -332,7 +332,7 @@ char* gCourseNamesDup2[] = { #include "assets/course_metadata/gCourseNames.inc.c" }; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE // Used in debug menu at splash screen char* gDebugCourseNames[] = { #include "assets/course_metadata/gCourseDebugNames.inc.c" diff --git a/src/data/path_spawn_metadata.c b/src/data/path_spawn_metadata.c index 71ac2ec13..eccb145d7 100644 --- a/src/data/path_spawn_metadata.c +++ b/src/data/path_spawn_metadata.c @@ -2,7 +2,7 @@ #include "courses/all_course_data.h" #include -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE // @warning Array contains an extra zero element at the end. KartAIBehaviour* gKartAIBehaviourLUT[] = { #include "assets/course_metadata/gKartAIBehaviourLUT.inc.c" @@ -14,7 +14,7 @@ KartAIBehaviour* gKartAIBehaviourLUT[] = { TrackWaypoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 }; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE TrackWaypoint* gCoursePathTable[][4] = { #include "assets/course_metadata/gCoursePathTableUnknown.inc.c" }; @@ -68,7 +68,7 @@ BombKartSpawn gBombKartSpawns[][NUM_BOMB_KARTS_MAX] = { #include "assets/course_metadata/gBombKartSpawns.inc.c" }; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE struct _struct_gCoursePathSizes_0x10 gCoursePathSizes[] = { #include "assets/course_metadata/gCoursePathSizes.inc.c" }; diff --git a/src/effects.c b/src/effects.c index d279c2703..d83eb21d4 100644 --- a/src/effects.c +++ b/src/effects.c @@ -1591,7 +1591,7 @@ void func_8008FEDC(Player* player, UNUSED s8 arg1) { void course_update_waypoint(Player* player, s8 playerId) { s16 waypoint; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_BOWSER_CASTLE: waypoint = gNearestWaypointByPlayerId[playerId]; diff --git a/src/player_controller.c b/src/player_controller.c index 0b5209043..040198876 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -247,7 +247,7 @@ void func_80027EDC(Player* player, s8 playerId) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && @@ -382,7 +382,7 @@ void func_80027EDC(Player* player, s8 playerId) { #endif } else { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && diff --git a/src/racing/actors.c b/src/racing/actors.c index ed9bd0847..e60249023 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -1053,7 +1053,7 @@ void spawn_course_actors(void) { struct RailroadCrossing* rrxing; gNumPermanentActors = 0; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: spawn_foliage(d_course_mario_raceway_tree_spawns); @@ -1212,7 +1212,7 @@ void init_actors_and_load_textures(void) { dma_textures(gTextureFinishLineBanner8, 0x0000025BU, 0x00000800U); dma_textures(gTexture671A88, 0x00000400U, 0x00000800U); dma_textures(gTexture6774D8, 0x00000400U, 0x00000800U); -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: dma_textures(gTextureTrees1, 0x0000035BU, 0x00000800U); diff --git a/src/racing/render_courses.c b/src/racing/render_courses.c index 936cf662c..4cb202acb 100644 --- a/src/racing/render_courses.c +++ b/src/racing/render_courses.c @@ -1260,11 +1260,12 @@ void render_big_donut(struct UnkStruct_800DC5EC* arg0) { } /** - * @brief dev made two version of the Course one for 1-4p and another for credit. + * @brief The game has two versions of each course. One for normal gameplay and another for credits. + * The credits version is not split into segments so that the game camera can fly around the whole course. * */ void render_course_credits(void) { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_9348); @@ -1340,7 +1341,7 @@ void render_course(struct UnkStruct_800DC5EC* arg0) { return; } -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: render_mario_raceway(arg0); @@ -1466,7 +1467,7 @@ void course_generate_collision_mesh(void) { gCollisionMesh = (CollisionTriangle*) gNextFreeMemoryAddress; D_800DC5BC = 0; D_800DC5C8 = 0; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: // d_course_mario_raceway_packed_dl_1140 @@ -1678,7 +1679,7 @@ void course_generate_collision_mesh(void) { } void course_update_water(void) { -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_KOOPA_BEACH: // clang-format off diff --git a/src/racing/skybox_and_splitscreen.c b/src/racing/skybox_and_splitscreen.c index ead261ddc..281cedda3 100644 --- a/src/racing/skybox_and_splitscreen.c +++ b/src/racing/skybox_and_splitscreen.c @@ -406,7 +406,7 @@ void course_set_skybox_colours(Vtx* skybox) { return; } -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE skybox[0].v.cn[0] = sTopSkyBoxColors[gCurrentCourseId].topRed; skybox[0].v.cn[1] = sTopSkyBoxColors[gCurrentCourseId].topGreen; skybox[0].v.cn[2] = sTopSkyBoxColors[gCurrentCourseId].topBlue; diff --git a/src/render_objects.c b/src/render_objects.c index 44f6904f7..260ab35fa 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -2451,7 +2451,7 @@ void render_mini_map_finish_line(s32 arg0) { var_f2 = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX; var_f0 = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { /* irregular */ case COURSE_MARIO_RACEWAY: var_f0 = var_f0 - 2.0; diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c index 7a1b8feb3..080c49e3f 100644 --- a/src/staff_ghosts.c +++ b/src/staff_ghosts.c @@ -108,7 +108,7 @@ void func_80004FF8(void) { void set_staff_ghost(void) { u32 temp_v0; // Appears to be player total lap time. -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: temp_v0 = func_800B4E24(0) & 0xfffff; diff --git a/src/update_objects.c b/src/update_objects.c index c633b169f..e3de096e8 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -2868,7 +2868,7 @@ void course_update_clouds(s32 arg0) { D_8018D210 = (-(D_8018D200 / 2) * 0xB6) - 0x71C; D_8018D1E8 = 1.7578125 / D_8018D200; D_8018D218 = 0xA0; -#if !USE_CUSTOM_COURSE_ENGINE +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { /* switch 2 */ case COURSE_MARIO_RACEWAY: /* switch 2 */ // Uses Luigi Raceway's clouds for display purposes?