Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+18 -17
View File
@@ -1,28 +1,29 @@
--{-# LANGUAGE TupleSections #-}
module Dodge.Render.Picture
( fixedCoordPictures
) where
import Dodge.Data
--import Dodge.Base.Window
module Dodge.Render.Picture (
fixedCoordPictures,
) where
import Dodge.Base.WinScale
import Dodge.Data.Universe
import Dodge.Render.HUD
import Dodge.Render.MenuScreen
import Geometry
import Picture
fixedCoordPictures :: Universe -> Picture
fixedCoordPictures u = case _menuLayers u of
[] -> pictures
[ hudDrawings u
, customMouseCursor cfig w
]
(lay:_) -> setDepth (-1) . winScale cfig $ menuScreen u lay
where
fixedCoordPictures u = case _menuLayers u of
[] ->
pictures
[ hudDrawings u
, customMouseCursor cfig w
]
(lay : _) -> setDepth (-1) . winScale cfig $ menuScreen u lay
where
w = _uvWorld u
cfig = _uvConfig u
customMouseCursor :: Configuration -> World -> Picture
customMouseCursor cfig w = winScale cfig
. uncurryV translate (_mousePos w)
. color white
$ pictures [ line [V2 (-5) 0,V2 5 0] , line [V2 0 (-5),V2 0 5] ]
customMouseCursor cfig w =
winScale cfig
. uncurryV translate (_mousePos w)
. color white
$ pictures [line [V2 (-5) 0, V2 5 0], line [V2 0 (-5), V2 0 5]]