Name ScreenContext, Refactor Course class to Track (#583)

* Rename Screen Contexts

* typedef ScreenContext struct

* Fix Compile

* Rename Course.cpp to Track.cpp

* Refactor Course to Track

* A few renames

* General Cleanup

* More Rename

* More names

* Move TrackSections struct to Track.h

---------

Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
This commit is contained in:
MegaMech
2025-12-07 21:00:06 -07:00
committed by GitHub
parent 04ca19a975
commit dbae0c3aca
156 changed files with 1531 additions and 3949 deletions
+10 -10
View File
@@ -52,15 +52,15 @@ extern "C" void add_triangle_to_collision_mesh(Vtx* vtx1, Vtx* vtx2, Vtx* vtx3,
}
void RaceManager::Load() {
if (WorldContext.GetCurrentCourse()) {
if (WorldContext.GetTrack()) {
mirroredVtxCache.clear();
WorldContext.GetCurrentCourse()->Load();
WorldContext.GetTrack()->Load();
}
}
void RaceManager::UnLoad() {
if (WorldContext.GetCurrentCourse()) {
WorldContext.GetCurrentCourse()->UnLoad();
if (WorldContext.GetTrack()) {
WorldContext.GetTrack()->UnLoad();
}
}
@@ -74,14 +74,14 @@ void RaceManager::PreInit() {
}
void RaceManager::BeginPlay() {
auto course = WorldContext.GetCurrentCourse();
auto track = WorldContext.GetTrack();
if (course) {
if (track) {
// Do not spawn finishline in credits or battle mode. And if bSpawnFinishline.
if ((gGamestate != CREDITS_SEQUENCE) && (gModeSelection != BATTLE)) {
if (course->bSpawnFinishline) {
if (course->FinishlineSpawnPoint.has_value()) {
AFinishline::Spawn(course->FinishlineSpawnPoint.value(), IRotator(0, 0, 0));
if (track->bSpawnFinishline) {
if (track->FinishlineSpawnPoint.has_value()) {
AFinishline::Spawn(track->FinishlineSpawnPoint.value(), IRotator(0, 0, 0));
} else {
AFinishline::Spawn();
}
@@ -90,7 +90,7 @@ void RaceManager::BeginPlay() {
}
gEditor.AddLight("Sun", nullptr, D_800DC610[1].l->l.dir);
course->BeginPlay();
track->BeginPlay();
}
}