From 818485b5016502e1b6e32856ca8fdc4074e741b3 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Tue, 21 Jun 2022 18:22:31 -0400 Subject: [PATCH] paths: ensure `imgui` and `game_config` respects the project path (#1505) * paths: ensure `imgui` respects the project path * paths: remove extra creation of `game_config/` this is done when the settings are saved --- common/custom_data/TFrag3Data.cpp | 3 ++- game/graphics/pipelines/opengl.cpp | 5 +++++ game/runtime.cpp | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/custom_data/TFrag3Data.cpp b/common/custom_data/TFrag3Data.cpp index bd36741f69..879ee585da 100644 --- a/common/custom_data/TFrag3Data.cpp +++ b/common/custom_data/TFrag3Data.cpp @@ -297,7 +297,8 @@ void MercModelGroup::serialize(Serializer& ser) { void Level::serialize(Serializer& ser) { ser.from_ptr(&version); if (ser.is_loading() && version != TFRAG3_VERSION) { - ASSERT_MSG(false, fmt::format("version mismatch when loading tfrag3 data. Got {}, expected {}", + ASSERT_MSG(false, fmt::format("version mismatch when loading tfrag3 data. Got {}, expected {}, " + "did you forget to re-decompile?", version, TFRAG3_VERSION)); } diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index 909b628f5f..584130db69 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -234,6 +234,11 @@ static std::shared_ptr gl_make_display(int width, // this does initialization for stuff like the font data ImGui::CreateContext(); + // Init ImGui settings + ImGuiIO& io = ImGui::GetIO(); + io.IniFilename = file_util::get_file_path({"imgui.ini"}).c_str(); + io.LogFilename = file_util::get_file_path({"imgui_log.txt"}).c_str(); + // set up to get inputs for this window ImGui_ImplGlfw_InitForOpenGL(window, true); diff --git a/game/runtime.cpp b/game/runtime.cpp index 659652ed0b..8758933212 100644 --- a/game/runtime.cpp +++ b/game/runtime.cpp @@ -282,8 +282,6 @@ RuntimeExitStatus exec_runtime(int argc, char** argv) { g_argv = argv; g_main_thread_id = std::this_thread::get_id(); - file_util::create_dir_if_needed("game_config/"); - // parse opengoal arguments bool enable_display = true; for (int i = 1; i < argc; i++) {