From e85b7ddbe956e4def366876d0e4ee8256dae952a Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 16 Nov 2024 17:47:00 -0700 Subject: [PATCH] Add disable lod to mrw pipe --- src/engine/courses/MarioRaceway.cpp | 20 ++++++++++---------- src/racing/render_courses.c | 28 +++++++++++++++++----------- src/racing/render_courses.h | 2 +- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/engine/courses/MarioRaceway.cpp b/src/engine/courses/MarioRaceway.cpp index f93b76762..e0cfd1f59 100644 --- a/src/engine/courses/MarioRaceway.cpp +++ b/src/engine/courses/MarioRaceway.cpp @@ -270,12 +270,12 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) { case 2: case 17: if ((temp_t0 == 2) || (temp_t0 == 1)) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 3: if (temp_t0 != 0) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 4: @@ -285,13 +285,13 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) { if (temp_t0 == 1) { func_80291198(); } - func_802911C4(); + render_mario_raceway_pipe(); } break; case 5: case 6: if ((temp_t0 == 2) || (temp_t0 == 3)) { - func_802911C4(); + render_mario_raceway_pipe(); } else { func_80291198(); } @@ -299,13 +299,13 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) { case 7: func_80291198(); if ((temp_t0 == 2) || (temp_t0 == 3)) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 8: case 9: if (temp_t0 != 1) { - func_802911C4(); + render_mario_raceway_pipe(); } /* fallthrough */ case 10: @@ -315,15 +315,15 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) { break; case 11: if (temp_t0 == 0) { - func_802911C4(); + render_mario_raceway_pipe(); func_80291198(); } else if (temp_t0 == 3) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 12: if ((temp_t0 == 0) || (temp_t0 == 3)) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 13: @@ -331,7 +331,7 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) { if (temp_t0 != 1) { case 15: case 16: - func_802911C4(); + render_mario_raceway_pipe(); } break; } diff --git a/src/racing/render_courses.c b/src/racing/render_courses.c index 7af74516b..bf5d8dd09 100644 --- a/src/racing/render_courses.c +++ b/src/racing/render_courses.c @@ -187,11 +187,17 @@ void func_80291198(void) { gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x07001140))); // } -void func_802911C4(void) { +void render_mario_raceway_pipe(void) { + + if (gScreenModeSelection == SCREEN_MODE_1P) { // d_course_mario_raceway_packed_dl_8E8 gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x070008E8))); } else { + if (CVarGetInteger("gDisableLod", 0) == true) { + gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x070008E8))); + return; + } // d_course_mario_raceway_packed_dl_2D68 gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x07002D68))); } @@ -548,12 +554,12 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) { case 2: case 17: if ((playerDirection == 2) || (playerDirection == 1)) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 3: if (playerDirection != 0) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 4: @@ -563,13 +569,13 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) { if (playerDirection == 1) { func_80291198(); } - func_802911C4(); + render_mario_raceway_pipe(); } break; case 5: case 6: if ((playerDirection == 2) || (playerDirection == 3)) { - func_802911C4(); + render_mario_raceway_pipe(); } else { func_80291198(); } @@ -577,13 +583,13 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) { case 7: func_80291198(); if ((playerDirection == 2) || (playerDirection == 3)) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 8: case 9: if (playerDirection != 1) { - func_802911C4(); + render_mario_raceway_pipe(); } /* fallthrough */ case 10: @@ -593,15 +599,15 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) { break; case 11: if (playerDirection == 0) { - func_802911C4(); + render_mario_raceway_pipe(); func_80291198(); } else if (playerDirection == 3) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 12: if ((playerDirection == 0) || (playerDirection == 3)) { - func_802911C4(); + render_mario_raceway_pipe(); } break; case 13: @@ -609,7 +615,7 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) { if (playerDirection != 1) { case 15: case 16: - func_802911C4(); + render_mario_raceway_pipe(); } break; } diff --git a/src/racing/render_courses.h b/src/racing/render_courses.h index dfb05c58b..e1e87fcc9 100644 --- a/src/racing/render_courses.h +++ b/src/racing/render_courses.h @@ -16,7 +16,7 @@ s32 func_80290C20(Camera*); void parse_course_displaylists(TrackSectionsI* asset); void render_course_segments(const char*[], struct UnkStruct_800DC5EC*); void func_80291198(void); -void func_802911C4(void); +void render_mario_raceway_pipe(void); void render_choco_mountain(struct UnkStruct_800DC5EC*); void render_bowsers_castle(struct UnkStruct_800DC5EC*); void render_banshee_boardwalk(struct UnkStruct_800DC5EC*);