Refactor, try to limit dependencies
This commit is contained in:
+18
-17
@@ -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]]
|
||||
|
||||
Reference in New Issue
Block a user