Rename LoadLevel to LoadTrackDataFromJson

This commit is contained in:
MegaMech 2025-12-12 00:02:06 -07:00
parent f1d86aeb2d
commit bf14678997
3 changed files with 8 additions and 7 deletions

View File

@ -83,8 +83,8 @@ namespace Editor {
}
/** Do not use GetWorld()->CurrentCourse during loading! The current track is not guaranteed! **/
void LoadLevel(Track* track, const std::string& trackPath) {
SPDLOG_INFO("[SceneManager] [LoadLevel] Loading track scenefile...");
void LoadTrackDataFromJson(Track* track, const std::string& trackPath) {
SPDLOG_INFO("[SceneManager] [LoadTrackDataFromJson] Loading track scenefile...");
if (trackPath.empty()) {
SPDLOG_INFO(" Unable to load track. trackPath empty.");
@ -127,12 +127,12 @@ namespace Editor {
LoadActors(track, data);
LoadStaticMeshActors(track, data);
LoadTour(track, data);
SPDLOG_INFO("[SceneManager] [LoadLevel] Scene File Loaded!");
SPDLOG_INFO("[SceneManager] [LoadTrackDataFromJson] Scene File Loaded!");
}
void LoadTrackInfo(TrackInfo& info, std::shared_ptr<Ship::Archive> archive, std::string sceneFile) {
if (nullptr == archive) {
SPDLOG_INFO("[SceneManager] [LoadLevel] Failed to load scenefile, track or rootarchive were null");
SPDLOG_INFO("[SceneManager] [LoadTrackDataFromJson] Failed to load scenefile, track or rootarchive were null");
return;
}

View File

@ -8,7 +8,7 @@
namespace Editor {
void SaveLevel(Track* track);
void LoadLevel(Track* track, const std::string& trackPath);
void LoadTrackDataFromJson(Track* track, const std::string& trackPath);
void LoadTrackInfo(TrackInfo& info, std::shared_ptr<Ship::Archive> archive, std::string sceneFile);
void Load_AddStaticMeshActor(const nlohmann::json& actorJson);
void LoadMinimap(Track* track, std::string filePath);

View File

@ -338,9 +338,10 @@ void Track::Load() {
Track::Init();
} else { // Load custom track
bIsMod = true;
Editor::LoadLevel(this, trackPath);
const std::string trackSectionPath = (trackPath + "/data_track_sections");
Editor::LoadTrackDataFromJson(this, trackPath);
const std::string trackSectionPath = (trackPath + "/data_track_sections");
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(trackSectionPath.c_str());
size_t size = ResourceGetSizeByName(trackSectionPath.c_str());