mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-09-24 22:35:57 +00:00
Adapted version check to v0.9
This commit is contained in:
@@ -415,8 +415,6 @@ bool Config::Reload(std::filesystem::path iniPath)
|
||||
|
||||
if (AnisotropyOverride.has_value() && (AnisotropyOverride.value() > 16 || AnisotropyOverride.value() < 1))
|
||||
AnisotropyOverride.reset();
|
||||
CheckForUpdate.set_from_config(readBool("Hotfix", "CheckForUpdate"));
|
||||
DisableOverlays.set_from_config(readBool("Hotfix", "DisableOverlays"));
|
||||
|
||||
AnisotropySkipPointFilter.set_from_config(readBool("Anisotropy", "SkipPointFilter"));
|
||||
AnisotropyModifyComp.set_from_config(readBool("Anisotropy", "AFModifyComparison"));
|
||||
@@ -442,6 +440,7 @@ bool Config::Reload(std::filesystem::path iniPath)
|
||||
|
||||
// Hotfixes
|
||||
{
|
||||
CheckForUpdate.set_from_config(readBool("Hotfix", "CheckForUpdate"));
|
||||
DisableOverlays.set_from_config(readBool("Hotfix", "DisableOverlays"));
|
||||
|
||||
RoundInternalResolution.set_from_config(readInt("Hotfix", "RoundInternalResolution"));
|
||||
@@ -935,12 +934,6 @@ bool Config::SaveIni()
|
||||
ini.SetValue("Anisotropy", "SkipPointFilter",
|
||||
GetBoolValue(Instance()->AnisotropySkipPointFilter.value_for_config()).c_str());
|
||||
}
|
||||
ini.SetValue("Hotfix", "CheckForUpdate",
|
||||
Instance()->CheckForUpdate.has_value() ? (Instance()->CheckForUpdate.value() ? "true" : "false")
|
||||
: "auto");
|
||||
ini.SetValue("Hotfix", "DisableOverlays",
|
||||
Instance()->DisableOverlays.has_value() ? (Instance()->DisableOverlays.value() ? "true" : "false")
|
||||
: "auto");
|
||||
|
||||
// Mipmap
|
||||
{
|
||||
@@ -956,6 +949,9 @@ bool Config::SaveIni()
|
||||
|
||||
// Hotfixes
|
||||
{
|
||||
ini.SetValue("Hotfix", "CheckForUpdate",
|
||||
Instance()->CheckForUpdate.has_value() ? (Instance()->CheckForUpdate.value() ? "true" : "false")
|
||||
: "auto");
|
||||
ini.SetValue("Hotfix", "DisableOverlays",
|
||||
Instance()->DisableOverlays.has_value() ? (Instance()->DisableOverlays.value() ? "true" : "false")
|
||||
: "auto");
|
||||
|
||||
@@ -1160,16 +1160,12 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
|
||||
spdlog::info("Config parameters:");
|
||||
for (const std::string& l : Config::Instance()->GetConfigLog())
|
||||
spdlog::info(l);
|
||||
|
||||
#ifdef VER_PRE_RELEASE
|
||||
spdlog::info("Pre-release build, disabling update checks");
|
||||
Config::Instance()->CheckForUpdate.set_volatile_value(false);
|
||||
#endif
|
||||
|
||||
// OptiFG & Overlay Checks
|
||||
if (Config::Instance()->FGType.value_or_default() == FGType::OptiFG &&
|
||||
!Config::Instance()->DisableOverlays.has_value())
|
||||
Config::Instance()->DisableOverlays.set_volatile_value(true);
|
||||
|
||||
// Initial state of FG
|
||||
State::Instance().activeFgInput = Config::Instance()->FGInput.value_or_default();
|
||||
State::Instance().activeFgOutput = Config::Instance()->FGOutput.value_or_default();
|
||||
|
||||
@@ -1435,6 +1435,7 @@ bool MenuCommon::RenderMenu()
|
||||
inputFpsCycle = false;
|
||||
}
|
||||
|
||||
// Version check
|
||||
bool frameTimesCalculated = false;
|
||||
const double splashTime = 7000.0;
|
||||
const double fadeTime = 1000.0;
|
||||
@@ -1475,32 +1476,40 @@ bool MenuCommon::RenderMenu()
|
||||
}
|
||||
}
|
||||
|
||||
if (!_isUWP)
|
||||
if (splashLimit < 1.0f)
|
||||
{
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
}
|
||||
else if (!newFrame)
|
||||
{
|
||||
ImVec2 displaySize { State::Instance().screenWidth, State::Instance().screenHeight };
|
||||
ImGui_ImplUwp_NewFrame(displaySize);
|
||||
splashStart = now + 100.0;
|
||||
splashLimit = splashStart + splashTime;
|
||||
|
||||
std::srand(static_cast<unsigned>(std::time(nullptr)));
|
||||
splashMessage = splashText[std::rand() % splashText.size()];
|
||||
}
|
||||
|
||||
MenuHdrCheck(io);
|
||||
MenuSizeCheck(io);
|
||||
ImGui::NewFrame();
|
||||
// New frame check
|
||||
if ((!Config::Instance()->DisableSplash.value_or_default() && now > splashStart && now < splashLimit) ||
|
||||
(updateNoticeVisible && now < updateNoticeLimit) || Config::Instance()->ShowFps.value_or_default() ||
|
||||
_isVisible)
|
||||
{
|
||||
if (!_isUWP)
|
||||
{
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImVec2 displaySize { State::Instance().screenWidth, State::Instance().screenHeight };
|
||||
ImGui_ImplUwp_NewFrame(displaySize);
|
||||
}
|
||||
|
||||
MenuHdrCheck(io);
|
||||
MenuSizeCheck(io);
|
||||
ImGui::NewFrame();
|
||||
|
||||
newFrame = true;
|
||||
}
|
||||
|
||||
// Splash screen
|
||||
if (!Config::Instance()->DisableSplash.value_or_default())
|
||||
{
|
||||
if (splashLimit < 1.0f)
|
||||
{
|
||||
splashStart = now + 100.0;
|
||||
splashLimit = splashStart + splashTime;
|
||||
|
||||
std::srand(static_cast<unsigned>(std::time(nullptr)));
|
||||
splashMessage = splashText[std::rand() % splashText.size()];
|
||||
}
|
||||
|
||||
if (now > splashStart && now < splashLimit)
|
||||
{
|
||||
|
||||
@@ -1535,7 +1544,9 @@ bool MenuCommon::RenderMenu()
|
||||
else
|
||||
ImGui::SetWindowFontScale(splashScale);
|
||||
|
||||
ImGui::Text("OptiScaler");
|
||||
ImGui::Text(
|
||||
"OptiScaler - %s for menu",
|
||||
Keybind::KeyNameFromVirtualKeyCode(Config::Instance()->ShortcutKey.value_or_default()).c_str());
|
||||
ImGui::TextColored(toneMapColor(ImVec4(1.0, 1.0, 1.0, 0.7)), splashMessage.c_str());
|
||||
|
||||
splashSize = ImGui::GetWindowSize();
|
||||
@@ -1965,13 +1976,11 @@ bool MenuCommon::RenderMenu()
|
||||
}
|
||||
}
|
||||
|
||||
if (!_isVisible)
|
||||
return false;
|
||||
|
||||
// Check for gpu support
|
||||
CheckForGPU();
|
||||
|
||||
if (_isVisible)
|
||||
{
|
||||
// Check for gpu support
|
||||
CheckForGPU();
|
||||
|
||||
// Overlay font
|
||||
if (Config::Instance()->UseHQFont.value_or_default())
|
||||
ImGui::PushFontSize(std::round(Config::Instance()->MenuScale.value_or_default() * fontSize));
|
||||
@@ -5228,11 +5237,12 @@ bool MenuCommon::RenderMenu()
|
||||
|
||||
if (Config::Instance()->UseHQFont.value_or_default())
|
||||
ImGui::PopFontSize();
|
||||
}
|
||||
|
||||
if (newFrame)
|
||||
ImGui::EndFrame();
|
||||
|
||||
return true;
|
||||
}
|
||||
return newFrame;
|
||||
}
|
||||
|
||||
void MenuCommon::Init(HWND InHwnd, bool isUWP)
|
||||
|
||||
Reference in New Issue
Block a user