diff --git a/src/Affection.hs b/src/Affection.hs index 4003009..fbec434 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -127,7 +127,7 @@ withAffection AffectionConfig{..} = do ad <- get -- Measure time difference form last run now <- liftIO $ getTime Monotonic - lastTime <- sysTime ad + let lastTime = sysTime ad -- clean draw requests from last run MP.mapM_ (invalidateDrawRequest (drawStride ad) (drawCPP ad)) (drawStack ad) -- clean the renderer form last time @@ -144,7 +144,7 @@ withAffection AffectionConfig{..} = do evs <- preHandleEvents =<< liftIO SDL.pollEvents mapM_ eventLoop evs -- execute user defined update loop - unless pausedTime (updateLoop dt) + unless (pausedTime ad) (updateLoop dt) -- execute user defined draw loop drawLoop -- handle all new draw requests diff --git a/src/Affection/Types.hs b/src/Affection/Types.hs index be4effb..9638d4d 100644 --- a/src/Affection/Types.hs +++ b/src/Affection/Types.hs @@ -41,6 +41,8 @@ import qualified BABL as B import Control.Monad.IO.Class import Control.Monad.State import qualified Control.Monad.Parallel as MP + +import System.Clock (TimeSpec) -- import Control.Monad.Reader -- import Control.Concurrent.MVar