diff options
| author | Sonic Dreamcaster <alejandro.asenjo88@gmail.com> | 2025-03-29 16:20:19 -0300 |
|---|---|---|
| committer | Sonic Dreamcaster <alejandro.asenjo88@gmail.com> | 2025-03-29 16:20:19 -0300 |
| commit | b23ad8adf08efb2e49c71dc63657513152c41029 (patch) | |
| tree | 63943e7797fdd3ef26b9dc0652f6ebd419606258 /src/port/ui/ImguiUI.cpp | |
| parent | a53538370384416b6692be5c8c1d64b655114240 (diff) | |
revert whatever happened here
Diffstat (limited to 'src/port/ui/ImguiUI.cpp')
| -rw-r--r-- | src/port/ui/ImguiUI.cpp | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 4e13f3f3..996d2bbb 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -246,7 +246,12 @@ void DrawSettingsMenu(){ { // FPS Slider const int minFps = 30; - static int maxFps = 360; + static int maxFps; + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { + maxFps = 360; + } else { + maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + } int currentFps = 0; #ifdef __WIIU__ UIWidgets::Spacer(0); @@ -309,20 +314,40 @@ void DrawSettingsMenu(){ CVarSetInteger("gInterpolationFPS", currentFps); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); #else - bool matchingRefreshRate = CVarGetInteger("gMatchRefreshRate", 0); + bool matchingRefreshRate = + CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11; UIWidgets::CVarSliderInt((currentFps == 30) ? "FPS: Original (30)" : "FPS: %d", "gInterpolationFPS", minFps, maxFps, 60, { .disabled = matchingRefreshRate }); #endif - UIWidgets::Tooltip( - "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " - "visual and does not impact game logic, execution of glitches etc.\n\n" - "A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse result." - ); + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { + UIWidgets::Tooltip( + "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " + "visual and does not impact game logic, execution of glitches etc.\n\n" + "A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse result." + ); + } else { + UIWidgets::Tooltip( + "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " + "visual and does not impact game logic, execution of glitches etc." + ); + } } // END FPS Slider - UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false); - UIWidgets::Tooltip("Matches interpolation value to the refresh rate of your display."); + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { + UIWidgets::Spacer(0); + if (ImGui::Button("Match Refresh Rate")) { + int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + if (hz >= 30 && hz <= 360) { + CVarSetInteger("gInterpolationFPS", hz); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + } + } + } else { + UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false); + } + + UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 0) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", @@ -369,7 +394,6 @@ void DrawSettingsMenu(){ if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); - UIWidgets::Tooltip("Removes tearing, but clamps your max FPS to your displays refresh rate."); } if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) { |
