Skip to content

Commit

Permalink
rename and change description
Browse files Browse the repository at this point in the history
  • Loading branch information
coco875 committed Oct 18, 2024
1 parent 744eec3 commit a73095a
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 35 deletions.
4 changes: 2 additions & 2 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions include/course.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions src/code_800029B0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/code_80005FD0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion src/code_8003DC40.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/code_80057C60.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/code_8006E9C0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/code_80091750.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/data/path_spawn_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "courses/all_course_data.h"
#include <assets/ceremony_data.h>

#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"
Expand All @@ -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"
};
Expand Down Expand Up @@ -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"
};
Expand Down
2 changes: 1 addition & 1 deletion src/effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/player_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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) &&
Expand Down
4 changes: 2 additions & 2 deletions src/racing/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions src/racing/render_courses.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/racing/skybox_and_splitscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/render_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/staff_ghosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/update_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit a73095a

Please sign in to comment.