Add explicit layer datatype

This commit is contained in:
2022-04-10 10:48:17 +01:00
parent edd82fb3ac
commit 77c3f83d20
27 changed files with 75 additions and 70 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ pjTimerF 0 i = props %~ IM.delete i
pjTimerF time i = props . ix i . pjUpdate .~ (\_ -> pjTimerF (time - 1) i)
drawDDA :: IM.IntMap IS.IntSet -> Picture
drawDDA = setLayer 1 . color (withAlpha 0.5 green) . IM.foldlWithKey' f blank
drawDDA = setLayer BloomLayer . color (withAlpha 0.5 green) . IM.foldlWithKey' f blank
where
f pic x' ys' = concatMapPic (\y -> polygon (rectNSEW (y+50) y (x+50) x)) ys `appendPic` pic
where
@@ -53,7 +53,7 @@ drawDDA = setLayer 1 . color (withAlpha 0.5 green) . IM.foldlWithKey' f blank
ys = map ((50 *) . fromIntegral) $ IS.toList ys'
debugWallZoningPic :: World -> Picture
debugWallZoningPic w = setLayer 1 $ zonesPic `appendPic` wallsPic
debugWallZoningPic w = setLayer BloomLayer $ zonesPic `appendPic` wallsPic
where
wallsPic = setDepth 25 . color yellow . concatMapPic (drawTheWall . _wlLine) $ IM.elems theWalls
drawTheWall (a,b) = thickLine 20 [a,b]