Skip to content

Commit

Permalink
Fix undeclared identifer when build the editor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jayman2000 committed Jun 29, 2024
1 parent d7ec515 commit 089244c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion editor/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ void InitCScripts() {
CreateNewMine();

// Setup include directories for OSIRIS
ddio_MakePath(path, Base_directory, "data", "levels", NULL);
ddio_MakePath(path, GetWritableBaseDirectory().string().c_str(), "data", "levels", NULL);
}

// Copied from winmain.cpp
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_lighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ void DoRadiosityForRooms() {

if (save_after_bsp) {
char filename[_MAX_PATH];
ddio_MakePath(filename, Base_directory, "BSPSave.D3L", NULL);
ddio_MakePath(filename, GetWritableBaseDirectory().string().c_str(), "BSPSave.D3L", NULL);

// Save the level to
SaveLevel(filename);
Expand Down Expand Up @@ -1141,7 +1141,7 @@ void DoRadiosityForRooms() {
SqueezeLightmaps(0, -1);

char filename[_MAX_PATH + 1];
ddio_MakePath(filename, Base_directory, "LightSave.D3L", NULL);
ddio_MakePath(filename, GetWritableBaseDirectory().string().c_str(), "LightSave.D3L", NULL);

// Save the level to disk
SaveLevel(filename);
Expand Down
4 changes: 2 additions & 2 deletions editor/gameeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void GameToEditor(bool set_viewer_from_player) {
if (Temp_level_saved) {
char filename[_MAX_PATH];

ddio_MakePath(filename, Base_directory, "GameSave.D3L", NULL); // make explicit path
ddio_MakePath(filename, GetWritableBaseDirectory().string().c_str(), "GameSave.D3L", NULL); // make explicit path
LoadLevel(filename);
Temp_level_saved = 0;
}
Expand Down Expand Up @@ -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);
ddio_SetWorkingDir(GetWritableBaseDirectory().string().c_str());

Osiris_ResetAllTimers();

Expand Down

0 comments on commit 089244c

Please sign in to comment.