summaryrefslogtreecommitdiff
path: root/src/engine/tracks/Track.cpp
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-12-15 12:29:58 -0700
committerGitHub <noreply@github.com>2025-12-15 12:29:58 -0700
commiteb11374093b07bd968ccb955eecd06133db0ab74 (patch)
tree8e584cd21b9ea22403c903621d300d8223a62c86 /src/engine/tracks/Track.cpp
parent2995361eb152a5c0c8add52c590e30ec916b81ec (diff)
Edit TrackInfo Properties (#594)
* Fix finishline for toads turnpike in extra * Fixed trash bin in extra * Refactor fov * Update scene.json * Allow setting fog * impl fog save & load * Fix modifying resourceName and rename editor namespace to trackeditor * small change
Diffstat (limited to 'src/engine/tracks/Track.cpp')
-rw-r--r--src/engine/tracks/Track.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/tracks/Track.cpp b/src/engine/tracks/Track.cpp
index 49fcddabf..8db929986 100644
--- a/src/engine/tracks/Track.cpp
+++ b/src/engine/tracks/Track.cpp
@@ -350,7 +350,6 @@ bool IsTriangleWindingInverted() {
return !gModifiedGfxSet.empty();
}
-
Track::Track() {
Props.SetText(Props.ResourceName, "mod:blank_track", sizeof(Props.ResourceName));
Props.SetText(Props.Name, "Blank Track", sizeof(Props.Name));
@@ -358,7 +357,7 @@ Track::Track() {
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
// Props.Cup = FLOWER_CUP;
// Props.CupIndex = 3;
- ResourceName = "";
+ ResourceName = "mod:blank_track";
Props.Minimap.Texture = minimap_mario_raceway;
Props.Minimap.Width = ResourceGetTexWidthByName(Props.Minimap.Texture);
Props.Minimap.Height = ResourceGetTexHeightByName(Props.Minimap.Texture);
@@ -450,7 +449,7 @@ void Track::Load() {
} else { // Load custom track
bIsMod = true;
- Editor::LoadTrackDataFromJson(this, trackPath);
+ TrackEditor::LoadTrackDataFromJson(this, trackPath);
const std::string trackSectionPath = (trackPath + "/data_track_sections");
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(trackSectionPath.c_str());
@@ -647,6 +646,10 @@ void Track::Draw(ScreenContext* arg0) {
}
const TrackInfo* info = gTrackRegistry.GetInfo(ResourceName);
+ if (nullptr == info) {
+ printf("[Track] [Draw] Resource name did not return a valid TrackInfo %s\n", ResourceName.c_str());
+ return;
+ }
std::string res = info->Path + "/data_track_sections";
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(res.c_str());