mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-25 07:36:45 +00:00
fixed ini saving path
This commit is contained in:
@@ -130,7 +130,7 @@ std::string GetFloatValue(std::optional<float> value)
|
||||
return std::to_string(value.value());
|
||||
}
|
||||
|
||||
bool Config::SaveIni(std::string name)
|
||||
bool Config::SaveIni()
|
||||
{
|
||||
// Upscalers
|
||||
ini.SetValue("Upscalers", "Dx11Upscaler", Instance()->Dx11Upscaler.value_or("auto").c_str());
|
||||
@@ -204,7 +204,8 @@ bool Config::SaveIni(std::string name)
|
||||
ini.SetValue("Log", "OpenConsole", GetBoolValue(Instance()->OpenConsole).c_str());
|
||||
ini.SetValue("Log", "LogFile", Instance()->LogFileName.value_or("auto").c_str());
|
||||
|
||||
return ini.SaveFile(name.c_str()) >= 0;
|
||||
auto fileName = absoluteFileName.wstring().c_str();
|
||||
return ini.SaveFile(fileName) >= 0;
|
||||
}
|
||||
|
||||
std::optional<std::string> Config::readString(std::string section, std::string key, bool lowercase)
|
||||
|
||||
+3
-4
@@ -91,13 +91,14 @@ public:
|
||||
// dx11wdx12
|
||||
std::optional<int> UseSafeSyncQueries;
|
||||
|
||||
// Engine Info
|
||||
// nvngx info
|
||||
NVSDK_NGX_EngineType NVNGX_Engine = NVSDK_NGX_ENGINE_TYPE_CUSTOM;
|
||||
bool NVNGX_EngineVersion5 = false;
|
||||
NVNGX_Api Api = NVNGX_NOT_SELECTED;
|
||||
NVSDK_NGX_LoggingInfo NVSDK_Logger{ nullptr, NVSDK_NGX_LOGGING_LEVEL_OFF, false };
|
||||
IFeature* CurrentFeature = nullptr;
|
||||
|
||||
// for realtime changes
|
||||
bool changeBackend = false;
|
||||
bool changeCAS = false;
|
||||
std::string newBackend = "";
|
||||
@@ -105,10 +106,8 @@ public:
|
||||
int xessDebugFrames = 5;
|
||||
float lastMipBias = 0.0f;
|
||||
|
||||
|
||||
|
||||
void Reload();
|
||||
bool SaveIni(std::string name);
|
||||
bool SaveIni();
|
||||
|
||||
static Config* Instance();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||
#include "spdlog/sinks/callback_sink.h"
|
||||
#include "Util.h"
|
||||
|
||||
static bool InitializeConsole()
|
||||
{
|
||||
@@ -77,7 +78,8 @@ void PrepareLogger()
|
||||
|
||||
if (Config::Instance()->LogToFile.value_or(false))
|
||||
{
|
||||
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(Config::Instance()->LogFileName.value_or("./OmniScaler.log"), true);
|
||||
auto logFile = Util::DllPath().parent_path() / "OmniScaler.log";
|
||||
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(Config::Instance()->LogFileName.value_or(logFile.string()), true);
|
||||
file_sink->set_level(spdlog::level::level_enum::trace);
|
||||
file_sink->set_pattern("[%H:%M:%S.%f] [%L] %v");
|
||||
|
||||
|
||||
Binary file not shown.
@@ -420,8 +420,8 @@ void Imgui_Base::RenderMenu()
|
||||
Config::Instance()->newBackend = "";
|
||||
|
||||
// Dx11
|
||||
ImGui::BeginDisabled(Config::Instance()->Api != NVNGX_DX11 ||
|
||||
(Config::Instance()->Api == NVNGX_DX11 && Config::Instance()->Dx11Upscaler.value_or("fsr22") == "fsr22"));
|
||||
ImGui::BeginDisabled(Config::Instance()->Api != NVNGX_DX11 ||
|
||||
(Config::Instance()->Api == NVNGX_DX11 && Config::Instance()->Dx11Upscaler.value_or("fsr22") == "fsr22"));
|
||||
|
||||
const char* sync[] = { "No Syncing", "Shared Fences", "Shared Fences + Flush", "Shared Fences + Query", "Mostly Queries" };
|
||||
|
||||
@@ -598,8 +598,7 @@ void Imgui_Base::RenderMenu()
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SliderFloat("Ratio", &ssRatio, (float)Config::Instance()->CurrentFeature->DisplayWidth() / (float)Config::Instance()->CurrentFeature->RenderWidth(),
|
||||
isXess12 ? 2.5f : 5.0f, "%.2f", ImGuiSliderFlags_NoRoundToFormat);
|
||||
ImGui::SliderFloat("Ratio", &ssRatio, (float)Config::Instance()->CurrentFeature->DisplayWidth() / (float)Config::Instance()->CurrentFeature->RenderWidth(), isXess12 ? 2.5f : 5.0f, "%.2f");
|
||||
|
||||
ImGui::EndDisabled();
|
||||
|
||||
@@ -836,7 +835,7 @@ void Imgui_Base::RenderMenu()
|
||||
ImGui::SameLine(ImGui::GetWindowWidth() - 130.0f);
|
||||
|
||||
if (ImGui::Button("Save INI"))
|
||||
Config::Instance()->SaveIni("nvngx.ini");
|
||||
Config::Instance()->SaveIni();
|
||||
|
||||
ImGui::SameLine(0.0f, 6.0f);
|
||||
|
||||
@@ -1003,7 +1002,7 @@ bool Imgui_Base::IsHandleDifferent()
|
||||
HWND frontWindow = GetForegroundWindow(); // Util::GetProcessWindow(); -- for linux compatibility
|
||||
GetWindowThreadProcessId(frontWindow, &procId);
|
||||
|
||||
if (processId != procId)
|
||||
if (processId != procId)
|
||||
return false;
|
||||
|
||||
if (frontWindow == _handle)
|
||||
|
||||
Reference in New Issue
Block a user