Linting, haddocking

This commit is contained in:
2021-04-29 15:31:07 +02:00
parent 750a67ea6e
commit 6a38950501
34 changed files with 506 additions and 441 deletions
+5 -6
View File
@@ -39,7 +39,7 @@ main = do
dodgeConfig <- loadDodgeConfig
setupLoop
(sizex,sizey)
(SDL.cursorVisible $= False >> doPreload' dodgeConfig >>= resizeSpareFBO sizex sizey)
(SDL.cursorVisible $= False >> doPreload >>= applyWorldConfig dodgeConfig)
(\x -> (SDL.cursorVisible $= True) >> cleanUpPreload x)
(fmap (setWindowSize sizex sizey keyConfig . (config .~ dodgeConfig)) firstWorld)
doSideEffects
@@ -64,14 +64,13 @@ doSideEffects preData w = do
foldr (=<<) (return (preData & soundData . playingSounds .~ newPlayingSounds
& frameTimer .~ endTicks)) (_doneSideEffects w)
doPreload' :: Dodge.Config.Data.Configuration -> IO (PreloadData a)
doPreload' config = do
doPreload :: IO (PreloadData a)
doPreload = do
lChunks <- loadSounds
lMusic <- loadMusic
let sData = SoundData {_loadedChunks = lChunks, _playingSounds = M.empty}
mData = MusicData {_loadedMusic = lMusic}
Mix.playMusic Mix.Forever (lMusic IM.! 0)
setVolume config
rData <- preloadRender
return $ PreloadData
{ _renderData = rData
@@ -87,6 +86,6 @@ checkForGlErrors = do
setWindowSize :: Int -> Int -> KeyConfigSDL-> World -> World
setWindowSize x y z w = w
& windowX .~ fromIntegral x
& windowY .~ fromIntegral y
& config . windowX .~ fromIntegral x
& config . windowY .~ fromIntegral y
& keyConfig .~ z