Correct small delta time errors.

This commit is contained in:
Skyth 2024-12-22 14:56:23 +03:00
parent 6921a54dc6
commit b3b14b4154

View file

@ -38,6 +38,14 @@ PPC_FUNC(sub_824EB490)
PPC_FUNC_IMPL(__imp__sub_822C1130); PPC_FUNC_IMPL(__imp__sub_822C1130);
PPC_FUNC(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; App::s_deltaTime = ctx.f1.f64;
SDL_PumpEvents(); SDL_PumpEvents();