From 1f583935325386ff0afa84c8d9e20232a10d4f27 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sun, 22 Dec 2024 16:59:38 -0300 Subject: [PATCH] fix interpolation issue --- src/port/Engine.cpp | 4 ++-- src/port/interpolation/FrameInterpolation.cpp | 2 +- src/port/ui/ImguiUI.cpp | 2 +- src/port/ui/ResolutionEditor.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index d8c9da22..15b0f17d 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -385,7 +385,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) { uint32_t GameEngine::GetInterpolationFPS() { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { - return CVarGetInteger("gInterpolationFPS", 20); + return CVarGetInteger("gInterpolationFPS", 60); } if (CVarGetInteger("gMatchRefreshRate", 0)) { @@ -393,7 +393,7 @@ uint32_t GameEngine::GetInterpolationFPS() { } return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), - CVarGetInteger("gInterpolationFPS", 20)); + CVarGetInteger("gInterpolationFPS", 60)); } extern "C" uint32_t GameEngine_GetSampleRate() { diff --git a/src/port/interpolation/FrameInterpolation.cpp b/src/port/interpolation/FrameInterpolation.cpp index 19507094..8d6c31ce 100644 --- a/src/port/interpolation/FrameInterpolation.cpp +++ b/src/port/interpolation/FrameInterpolation.cpp @@ -484,7 +484,7 @@ void FrameInterpolation_RecordMarker(const char* file, int line) { if (!is_recording) return; - append(Op::Marker).marker = { file, line }; + // append(Op::Marker).marker = { file, line }; } void FrameInterpolation_RecordMatrixPop(Matrix** matrix) { diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 27e23b4b..af9c6f22 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -282,7 +282,7 @@ void DrawSettingsMenu(){ #else bool matchingRefreshRate = CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11; - UIWidgets::CVarSliderInt((currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", "gInterpolationFPS", minFps, maxFps, 30, { + UIWidgets::CVarSliderInt((currentFps == 30) ? "FPS: Original (30)" : "FPS: %d", "gInterpolationFPS", minFps, maxFps, 60, { .disabled = matchingRefreshRate }); #endif diff --git a/src/port/ui/ResolutionEditor.cpp b/src/port/ui/ResolutionEditor.cpp index f28ae392..cac3b8be 100644 --- a/src/port/ui/ResolutionEditor.cpp +++ b/src/port/ui/ResolutionEditor.cpp @@ -59,7 +59,7 @@ namespace AdvancedResolutionSettings { for (unsigned short i = 0; i < sizeof(setting); i++) update[i] = false; static short updateCountdown = 0; - short countdownStartingValue = CVarGetInteger("gInterpolationFPS", 20) / 2; // half of a second, in frames. + short countdownStartingValue = CVarGetInteger("gInterpolationFPS", 60) / 2; // half of a second, in frames. // Initialise integer scale bounds. short max_integerScaleFactor = default_maxIntegerScaleFactor; // default value, which may or may not get @@ -408,7 +408,7 @@ namespace AdvancedResolutionSettings { bool AdvancedResolutionSettingsWindow::IsDroppingFrames() { // a rather imprecise way of checking for frame drops. // but it's mostly there to inform the player of large drops. - const short targetFPS = CVarGetInteger("gInterpolationFPS", 20); + const short targetFPS = CVarGetInteger("gInterpolationFPS", 60); const float threshold = targetFPS / 20.0f + 4.1f; return ImGui::GetIO().Framerate < targetFPS - threshold; }