From 9534c490c5c318e6c29ebf881ac5350545f479e5 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 7 Feb 2023 16:08:13 +0000 Subject: Using OverloadedRecordDot --- src/Game.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/Game.hs') diff --git a/src/Game.hs b/src/Game.hs index 667053d..5a974c6 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -79,10 +79,10 @@ main = do toggleFullscreen :: ReaderT Env IO () toggleFullscreen = do env <- ask - let fullscreen = _fullscreen env - renderRect = _renderRect env - renderer = _renderer env - window = _window env + let fullscreen = env._fullscreen + renderRect = env._renderRect + renderer = env._renderer + window = env._window fullscreen $~ not fs <- SDL.get fullscreen let mode = if fs then SDL.FullscreenDesktop else SDL.Windowed @@ -104,12 +104,12 @@ toggleFullscreen = do gameLoop :: ReaderT Env IO () gameLoop = do env <- ask - let renderer = _renderer env - canvas = _canvas env - renderRect = _renderRect env - controls = _controls env - map' = _map env - entities = _entities env + let renderer = env._renderer + canvas = env._canvas + renderRect = env._renderRect + controls = env._controls + map' = env._map + entities = env._entities events <- map SDL.eventPayload <$> SDL.pollEvents @@ -125,7 +125,7 @@ gameLoop = do SDL.rendererRenderTarget renderer $= Just canvas SDL.clear renderer - updated <- liftIO $ E.update =<< readIORef entities + updated <- liftIO $ E.updateAll =<< readIORef entities entities $= updated -- render map and entities -- cgit v1.2.3