From b3b14b415429ebbdcfdee792da2b2f104ca0c4d6 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:56:23 +0300 Subject: [PATCH] Correct small delta time errors. --- UnleashedRecomp/app.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp index f411a7bd..327e324e 100644 --- a/UnleashedRecomp/app.cpp +++ b/UnleashedRecomp/app.cpp @@ -38,6 +38,14 @@ PPC_FUNC(sub_824EB490) PPC_FUNC_IMPL(__imp__sub_822C1130); PPC_FUNC(sub_822C1130) { + // Correct small delta time errors. + if (Config::FPS >= 15 && Config::FPS < 240) + { + double targetDeltaTime = 1.0 / Config::FPS; + if (abs(ctx.f1.f64 - targetDeltaTime) < 0.001) + ctx.f1.f64 = targetDeltaTime; + } + App::s_deltaTime = ctx.f1.f64; SDL_PumpEvents();