fix interpolation issue

This commit is contained in:
Sonic Dreamcaster 2024-12-22 16:59:38 -03:00
parent bcf12744d2
commit 1f58393532
4 changed files with 6 additions and 6 deletions

View File

@ -385,7 +385,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) {
uint32_t GameEngine::GetInterpolationFPS() { uint32_t GameEngine::GetInterpolationFPS() {
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
return CVarGetInteger("gInterpolationFPS", 20); return CVarGetInteger("gInterpolationFPS", 60);
} }
if (CVarGetInteger("gMatchRefreshRate", 0)) { if (CVarGetInteger("gMatchRefreshRate", 0)) {
@ -393,7 +393,7 @@ uint32_t GameEngine::GetInterpolationFPS() {
} }
return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(),
CVarGetInteger("gInterpolationFPS", 20)); CVarGetInteger("gInterpolationFPS", 60));
} }
extern "C" uint32_t GameEngine_GetSampleRate() { extern "C" uint32_t GameEngine_GetSampleRate() {

View File

@ -484,7 +484,7 @@ void FrameInterpolation_RecordMarker(const char* file, int line) {
if (!is_recording) if (!is_recording)
return; return;
append(Op::Marker).marker = { file, line }; // append(Op::Marker).marker = { file, line };
} }
void FrameInterpolation_RecordMatrixPop(Matrix** matrix) { void FrameInterpolation_RecordMatrixPop(Matrix** matrix) {

View File

@ -282,7 +282,7 @@ void DrawSettingsMenu(){
#else #else
bool matchingRefreshRate = bool matchingRefreshRate =
CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11; 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 .disabled = matchingRefreshRate
}); });
#endif #endif

View File

@ -59,7 +59,7 @@ namespace AdvancedResolutionSettings {
for (unsigned short i = 0; i < sizeof(setting); i++) for (unsigned short i = 0; i < sizeof(setting); i++)
update[i] = false; update[i] = false;
static short updateCountdown = 0; 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. // Initialise integer scale bounds.
short max_integerScaleFactor = default_maxIntegerScaleFactor; // default value, which may or may not get short max_integerScaleFactor = default_maxIntegerScaleFactor; // default value, which may or may not get
@ -408,7 +408,7 @@ namespace AdvancedResolutionSettings {
bool AdvancedResolutionSettingsWindow::IsDroppingFrames() { bool AdvancedResolutionSettingsWindow::IsDroppingFrames() {
// a rather imprecise way of checking for frame drops. // a rather imprecise way of checking for frame drops.
// but it's mostly there to inform the player of large 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; const float threshold = targetFPS / 20.0f + 4.1f;
return ImGui::GetIO().Framerate < targetFPS - threshold; return ImGui::GetIO().Framerate < targetFPS - threshold;
} }