mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-10 13:38:08 -05:00
Revert FPS slider behaviour for DX11 (#2686)
This commit is contained in:
parent
e72eeb95aa
commit
831711a459
@ -868,7 +868,12 @@ namespace GameMenuBar {
|
|||||||
|
|
||||||
{ // FPS Slider
|
{ // FPS Slider
|
||||||
const int minFps = 20;
|
const int minFps = 20;
|
||||||
const int maxFps = Ship::Window::GetInstance()->GetCurrentRefreshRate();
|
static int maxFps;
|
||||||
|
if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) {
|
||||||
|
maxFps = 360;
|
||||||
|
} else {
|
||||||
|
maxFps = Ship::Window::GetInstance()->GetCurrentRefreshRate();
|
||||||
|
}
|
||||||
int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps);
|
int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps);
|
||||||
#ifdef __WIIU__
|
#ifdef __WIIU__
|
||||||
// only support divisors of 60 on the Wii U
|
// only support divisors of 60 on the Wii U
|
||||||
@ -932,8 +937,9 @@ namespace GameMenuBar {
|
|||||||
CVarSetInteger("gInterpolationFPS", currentFps);
|
CVarSetInteger("gInterpolationFPS", currentFps);
|
||||||
SohImGui::RequestCvarSaveOnNextTick();
|
SohImGui::RequestCvarSaveOnNextTick();
|
||||||
#else
|
#else
|
||||||
|
bool matchingRefreshRate = CVarGetInteger("gMatchRefreshRate", 0) && SohImGui::WindowBackend() != SohImGui::Backend::DX11;
|
||||||
UIWidgets::EnhancementSliderInt((currentFps == 20) ? "Frame interpolation: Off" : "Frame interpolation: %d FPS",
|
UIWidgets::EnhancementSliderInt((currentFps == 20) ? "Frame interpolation: Off" : "Frame interpolation: %d FPS",
|
||||||
"##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, CVarGetInteger("gMatchRefreshRate", 0));
|
"##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, matchingRefreshRate);
|
||||||
#endif
|
#endif
|
||||||
UIWidgets::Tooltip("Interpolate extra frames to get smoother graphics\n"
|
UIWidgets::Tooltip("Interpolate extra frames to get smoother graphics\n"
|
||||||
"Set to match your monitor's refresh rate, or a divisor of it\n"
|
"Set to match your monitor's refresh rate, or a divisor of it\n"
|
||||||
@ -942,7 +948,18 @@ namespace GameMenuBar {
|
|||||||
"Ctrl+Click for keyboard input");
|
"Ctrl+Click for keyboard input");
|
||||||
} // END FPS Slider
|
} // END FPS Slider
|
||||||
|
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false);
|
if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) {
|
||||||
|
ImGui::Dummy(ImVec2(0,0));
|
||||||
|
if (ImGui::Button("Match Refresh Rate")) {
|
||||||
|
int hz = Ship::Window::GetInstance()->GetCurrentRefreshRate();
|
||||||
|
if (hz >= 20 && hz <= 360) {
|
||||||
|
CVarSetInteger("gInterpolationFPS", hz);
|
||||||
|
SohImGui::RequestCvarSaveOnNextTick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false);
|
||||||
|
}
|
||||||
UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate");
|
UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate");
|
||||||
|
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Disable LOD", "gDisableLOD", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Disable LOD", "gDisableLOD", true, false);
|
||||||
|
@ -320,7 +320,7 @@ bool OTRGlobals::HasOriginal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t OTRGlobals::GetInterpolationFPS() {
|
uint32_t OTRGlobals::GetInterpolationFPS() {
|
||||||
if (CVarGetInteger("gMatchRefreshRate", 0)) {
|
if (CVarGetInteger("gMatchRefreshRate", 0) && SohImGui::WindowBackend() != SohImGui::Backend::DX11) {
|
||||||
return Ship::Window::GetInstance()->GetCurrentRefreshRate();
|
return Ship::Window::GetInstance()->GetCurrentRefreshRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user