diff --git a/affection.cabal b/affection.cabal index f5aa1e1..ce8a6fd 100644 --- a/affection.cabal +++ b/affection.cabal @@ -48,6 +48,7 @@ library , UndecidableInstances hs-source-dirs: src default-language: Haskell2010 + ghc-options: -Wall -- Other library packages from which modules are imported. build-depends: base >=4.9 && <4.10 , sdl2 diff --git a/src/Affection.hs b/src/Affection.hs index 362427f..205bcb9 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -21,7 +21,6 @@ import System.Clock import Control.Monad.Loops import Control.Monad.State -import Control.Monad.Reader import Control.Concurrent.MVar import Affection.Render @@ -31,7 +30,7 @@ import Affection.Types as Types withAffection :: AffectionConfig us -- ^ Configuration of the Game and its engine. -> IO () -withAffection conf@AffectionConfig{..} = do +withAffection AffectionConfig{..} = do case initComponents of All -> SDL.initializeAll @@ -40,16 +39,16 @@ withAffection conf@AffectionConfig{..} = do G.gegl_init execTime <- newMVar =<< getTime Monotonic window <- SDL.createWindow windowTitle windowConfig - oldSurf@(SDL.Surface ptr vect) <- SDL.getWindowSurface window + oldSurf@(SDL.Surface ptr _) <- SDL.getWindowSurface window surface <- (\x -> return $ SDL.Surface x Nothing) =<< - Raw.convertSurfaceFormat ptr Raw.SDL_PIXELFORMAT_ABGR8888 0 + Raw.convertSurfaceFormat ptr (SDL.toNumber SDL.ABGR8888) 0 initContainer <- return . (\x -> AffectionData { quitEvent = False , userState = x , drawWindow = window , drawSurface = surface }) =<< loadState surface - (res, nState) <- runStateT ( Types.runState $ + (_, _) <- runStateT ( Types.runState $ whileM_ (do current <- get return $ not $ Types.quitEvent current