From 026eb02d814a6395ac630dfa7d3697cdbc312177 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 22 Dec 2024 09:12:17 -0800 Subject: Fix animation. --- Spear/App.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spear/App.hs b/Spear/App.hs index ac5f7a5..93837c2 100644 --- a/Spear/App.hs +++ b/Spear/App.hs @@ -101,7 +101,7 @@ loop' window ddt animationDdt lastAnimationTime inputTimer app = do let dt = timeDeltaToSec ddt let timeBudgetThisFrame = timeDiff lastAnimationTime (lastTick timer) let steps = timeBudgetThisFrame `div` ddt - let lastAnimationTimeNextFrame = timeAdd lastAnimationTime (timeBudgetThisFrame `mod` ddt) + let lastAnimationTimeNextFrame = timeAdd lastAnimationTime (steps * ddt) --gameIO . print $ "Steps: " ++ show steps ++ ", Budget: " ++ show timeBudgetThisFrame ++ ", ddt: " ++ show ddt continue <- and <$> forM [1..steps] (\i -> do inputEvents <- gameIO $ pollInputEvents window -- cgit v1.2.3