From 58cfcb022e10f83bc3b889d7e97508cae6837098 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Tue, 11 Aug 2026 21:18:46 -0600 Subject: [PATCH] Clarify vehicle ticking and fix some func spellings (#781) * Update cpu_vehicles_camera_path.c * fix spelling * renames --- include/path.h | 2 +- src/cpu_vehicles_camera_path.c | 12 +++++++----- src/cpu_vehicles_camera_path.h | 8 ++++---- src/cpu_vehicles_camera_path/bomb_kart.inc.c | 2 +- src/cpu_vehicles_camera_path/path_calc.inc.c | 6 +++--- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/path.h b/include/path.h index e85613c14..bd4183cd1 100644 --- a/include/path.h +++ b/include/path.h @@ -34,7 +34,7 @@ extern TrackPathPoint* gTrackRightPaths[]; **/ // PathPoint types? extern s16* gTrackSectionTypes[]; -// Based on analyse_angle_path this may be angles between path point +// Based on analyze_path_angle this may be angles between path point // gPathExpectedRotation[i] = atan2(path_point_i, path_point_i+1)? extern s16* gPathExpectedRotation[]; // No idea. Adjacency list? diff --git a/src/cpu_vehicles_camera_path.c b/src/cpu_vehicles_camera_path.c index 042f6642d..45385eca8 100644 --- a/src/cpu_vehicles_camera_path.c +++ b/src/cpu_vehicles_camera_path.c @@ -1321,15 +1321,17 @@ void update_vehicles(void) { if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { for (i = 0; i < 7; i++) { - func_8000DF8C(i); + update_bomb_karts(i); } return; } + // update_vehicles is ran twice per frame. + // This makes vehicles only tick once per frame. if (D_8016337C & 1) { if (gModeSelection == VERSUS) { for (i = 0; i < 7; i++) { - func_8000DF8C(i); + update_bomb_karts(i); } } #if !ENABLE_CUSTOM_COURSE_ENGINE @@ -2037,9 +2039,9 @@ void init_course_path_point(void) { if (gSizePath[i] >= 2) { load_track_path(i); calculate_track_boundaries(i); - analize_track_section(i); - analyse_angle_path(i); - analisze_curved_path(i); + analyze_track_sections(i); + analyze_path_angle(i); + analyze_curved_path(i); } } diff --git a/src/cpu_vehicles_camera_path.h b/src/cpu_vehicles_camera_path.h index ddccbc5a5..a4aeef88b 100644 --- a/src/cpu_vehicles_camera_path.h +++ b/src/cpu_vehicles_camera_path.h @@ -149,7 +149,7 @@ s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16); s16 func_8000D940(Vec3f, s16*, f32, f32, s16); s16 update_vehicle_following_path(Vec3f, s16*, f32); void set_bomb_kart_spawn_positions(void); -void func_8000DF8C(s32); +void update_bomb_karts(s32); s32 add_actor_in_unexpired_actor_list(s32, s16); s32 add_red_shell_in_unexpired_actor_list(s32); @@ -168,10 +168,10 @@ void init_players(void); void load_track_path(s32); void calculate_track_boundaries(s32); f32 calculate_track_curvature(s32, u16); -void analize_track_section(s32); +void analyze_track_sections(s32); s16 calculate_angle_path(s32, s32); -void analyse_angle_path(s32); -void analisze_curved_path(s32); +void analyze_path_angle(s32); +void analyze_curved_path(s32); f32 func_80010F40(f32, f32, f32, s32, s32); f32 func_80010FA0(f32, f32, f32, s32, s32); diff --git a/src/cpu_vehicles_camera_path/bomb_kart.inc.c b/src/cpu_vehicles_camera_path/bomb_kart.inc.c index 74d150d46..296ff2c69 100644 --- a/src/cpu_vehicles_camera_path/bomb_kart.inc.c +++ b/src/cpu_vehicles_camera_path/bomb_kart.inc.c @@ -56,7 +56,7 @@ void set_bomb_kart_spawn_positions(void) { } } -void func_8000DF8C(s32 bombKartId) { +void update_bomb_karts(s32 bombKartId) { UNUSED s32 stackPadding0; f32 sp118; f32 var_f18; diff --git a/src/cpu_vehicles_camera_path/path_calc.inc.c b/src/cpu_vehicles_camera_path/path_calc.inc.c index fab0c3a6e..36724fba3 100644 --- a/src/cpu_vehicles_camera_path/path_calc.inc.c +++ b/src/cpu_vehicles_camera_path/path_calc.inc.c @@ -173,7 +173,7 @@ f32 calculate_track_curvature(s32 pathIndex, u16 pathPointIndex) { return -((firstVectorZ * secondVectorX) - (firstVectorX * secondVectorZ)) / (secondLength * firstLength); } -void analize_track_section(s32 pathIndex) { +void analyze_track_sections(s32 pathIndex) { f64 sectionCurvature; UNUSED s32 pad; s32 k; @@ -248,7 +248,7 @@ s16 calculate_angle_path(s32 pathIndex, s32 pathPointIndex) { } // Populates gPathExpectedRotation -void analyse_angle_path(s32 pathIndex) { +void analyze_path_angle(s32 pathIndex) { s32 pathPointIndex; u16* angle; @@ -260,7 +260,7 @@ void analyse_angle_path(s32 pathIndex) { } } -void analisze_curved_path(s32 pathIndex) { +void analyze_curved_path(s32 pathIndex) { s16* trackCurveCount; s16 curveCount; s16 temp_t0;