From fba08d37137d196861dc6a29498de55aa357d492 Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Sat, 29 Jun 2024 12:02:11 -0400 Subject: [PATCH] Fix undeclared identifer when build the editor Before this change, if you tried to compile Descent 3 with -D BUILD_EDITOR=ON, then it would fail with this error: error C2065: 'Base_directory': undeclared identifier --- editor/MainFrm.cpp | 2 +- editor/editor_lighting.cpp | 4 ++-- editor/gameeditor.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/MainFrm.cpp b/editor/MainFrm.cpp index 867d470dc..61cf794f8 100644 --- a/editor/MainFrm.cpp +++ b/editor/MainFrm.cpp @@ -1461,7 +1461,7 @@ void InitCScripts() { CreateNewMine(); // Setup include directories for OSIRIS - ddio_MakePath(path, Base_directory.u8string().c_str(), "data", "levels", NULL); + ddio_MakePath(path, GetWritableBaseDirectory().u8string().c_str(), "data", "levels", NULL); } // Copied from winmain.cpp diff --git a/editor/editor_lighting.cpp b/editor/editor_lighting.cpp index 7d91ec062..82456075c 100644 --- a/editor/editor_lighting.cpp +++ b/editor/editor_lighting.cpp @@ -871,7 +871,7 @@ void DoRadiosityForRooms() { if (save_after_bsp) { char filename[_MAX_PATH]; - ddio_MakePath(filename, Base_directory.u8string().c_str(), "BSPSave.D3L", NULL); + ddio_MakePath(filename, GetWritableBaseDirectory().u8string().c_str(), "BSPSave.D3L", NULL); // Save the level to SaveLevel(filename); @@ -1141,7 +1141,7 @@ void DoRadiosityForRooms() { SqueezeLightmaps(0, -1); char filename[_MAX_PATH + 1]; - ddio_MakePath(filename, Base_directory.u8string().c_str(), "LightSave.D3L", NULL); + ddio_MakePath(filename, GetWritableBaseDirectory().u8string().c_str(), "LightSave.D3L", NULL); // Save the level to disk SaveLevel(filename); diff --git a/editor/gameeditor.cpp b/editor/gameeditor.cpp index 8fee5f33c..ac1c9b275 100644 --- a/editor/gameeditor.cpp +++ b/editor/gameeditor.cpp @@ -620,7 +620,7 @@ void GameToEditor(bool set_viewer_from_player) { if (Temp_level_saved) { char filename[_MAX_PATH]; - ddio_MakePath(filename, Base_directory.u8string().c_str(), "GameSave.D3L", NULL); // make explicit path + ddio_MakePath(filename, GetWritableBaseDirectory().u8string().c_str(), "GameSave.D3L", NULL); // make explicit path LoadLevel(filename); Temp_level_saved = 0; } @@ -760,7 +760,7 @@ void EditorToGame() { // set game working directory bool set_size = false; ddio_GetWorkingDir(Editor_dir, sizeof(Editor_dir)); - ddio_SetWorkingDir(Base_directory.u8string().c_str()); + ddio_SetWorkingDir(GetWritableBaseDirectory().u8string().c_str()); Osiris_ResetAllTimers();