Custom Track Load path O2r

This commit is contained in:
MegaMech
2025-04-18 08:38:20 -06:00
parent a2d8302e32
commit e5114e3ad7
3 changed files with 19 additions and 10 deletions
+7 -1
View File
@@ -3635,7 +3635,13 @@ void func_800100F0(s32 pathIndex) {
pathDest = D_80164550[pathIndex];
bInvalidPath = 1;
if (GetCourse() != GetPodiumCeremony()) {
var_v0 = process_path_data(pathDest, CM_GetProps()->PathTable2[pathIndex]);
TrackWaypoint* pathSrc = CM_GetProps()->PathTable2[pathIndex];
if (pathSrc == NULL) {
printf("code_80005FD0.c: Path %d in Course::PathTable2, was NULL.\n Your track is missing a path\n", pathIndex);
}
var_v0 = process_path_data(pathDest, pathSrc);
gWaypointCountByPathIndex[pathIndex] = (u16) var_v0;
} else {
// Course path included in course_data which has already been loaded into memory.
+11 -8
View File
@@ -98,16 +98,19 @@ void Course::LoadO2R(std::string trackPath) {
auto res = std::dynamic_pointer_cast<MK64::Paths>(ResourceLoad(path_file.c_str()));
if (res != nullptr) {
std::vector<std::vector<TrackWaypointData>> paths = res->PathList;
auto& paths = res->PathList;
size_t i = 0;
for (auto& path : paths) {
if (i < 4) { // Paths 1-4
Props.PathTable[i] = (TrackWaypoint*)&path[0];
} else if (i < 8) { // Paths 5-8
Props.PathTable2[i - 4] = (TrackWaypoint*)&path[0];
} else { // Only 8 course paths are supported.
break;
if (i == 0) {
Props.PathTable[0] = (TrackWaypoint*)path.data();
Props.PathTable[1] = (TrackWaypoint*)path.data();
Props.PathTable[2] = (TrackWaypoint*)path.data();
Props.PathTable[3] = (TrackWaypoint*)path.data();
Props.PathTable2[0] = (TrackWaypoint*)path.data();
Props.PathTable2[1] = (TrackWaypoint*)path.data();
Props.PathTable2[2] = (TrackWaypoint*)path.data();
Props.PathTable2[3] = (TrackWaypoint*)path.data();
}
i += 1;
+1 -1
View File
@@ -248,7 +248,7 @@ namespace Editor {
printf("dir %s\n", directoryPath.c_str());
// Store in TrackPath
TrackPath[trackName] = file;
TrackPath[trackName] = directoryPath;
}
// Move unique tracks into the vector