diff options
author | 3gg <3gg@shellblade.net> | 2024-12-22 09:12:17 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-12-22 09:12:17 -0800 |
commit | 026eb02d814a6395ac630dfa7d3697cdbc312177 (patch) | |
tree | 4c5944c0286fa2727f22c7e8769cafbaba238a0f | |
parent | b7e420f96e5649ebc6bbbfc012fd002e5069fefa (diff) |
Fix animation.
-rw-r--r-- | Spear/App.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
101 | let dt = timeDeltaToSec ddt | 101 | let dt = timeDeltaToSec ddt |
102 | let timeBudgetThisFrame = timeDiff lastAnimationTime (lastTick timer) | 102 | let timeBudgetThisFrame = timeDiff lastAnimationTime (lastTick timer) |
103 | let steps = timeBudgetThisFrame `div` ddt | 103 | let steps = timeBudgetThisFrame `div` ddt |
104 | let lastAnimationTimeNextFrame = timeAdd lastAnimationTime (timeBudgetThisFrame `mod` ddt) | 104 | let lastAnimationTimeNextFrame = timeAdd lastAnimationTime (steps * ddt) |
105 | --gameIO . print $ "Steps: " ++ show steps ++ ", Budget: " ++ show timeBudgetThisFrame ++ ", ddt: " ++ show ddt | 105 | --gameIO . print $ "Steps: " ++ show steps ++ ", Budget: " ++ show timeBudgetThisFrame ++ ", ddt: " ++ show ddt |
106 | continue <- and <$> forM [1..steps] (\i -> do | 106 | continue <- and <$> forM [1..steps] (\i -> do |
107 | inputEvents <- gameIO $ pollInputEvents window | 107 | inputEvents <- gameIO $ pollInputEvents window |