Add IntMapHelper, locate wall cutting bug

This commit is contained in:
jgk
2021-05-22 15:14:21 +02:00
parent 26f0ca4ab5
commit 9c2bcbec10
35 changed files with 221 additions and 139 deletions
+6 -11
View File
@@ -8,21 +8,15 @@ module Dodge.Picture.Layer
) where
import Dodge.Picture.Layer.Data
import Picture
{- | Uses a layer to set the depth.
-}
{- | Uses a layer to set the depth. -}
onLayer :: Layer -> Picture -> Picture
onLayer l = setDepth $ 1 - fromIntegral (levLayer l) / 100
onLayer l = setDepth $ 1 - fromIntegral (levLayer l) / 100
{- | Set a depth according to a list of numbers.
Lists are lexicographically ordered if input values are always less than 100.
Higher numbers will get placed on top of lower numbers.
-}
Higher numbers will get placed on top of lower numbers. -}
onLayerL :: [Int] -> Picture -> Picture
onLayerL is = setDepth (1 - sum (zipWith (/) (map fromIntegral is) $ map (100 **) [1..]))
{- | For depth testing, set layer values.
-}
onLayerL is = setDepth (1 - sum (zipWith (/) (map fromIntegral is) $ map (100 **) [1..]))
{- | For depth testing, set layer values. -}
levLayer :: Layer -> Int
levLayer BgLayer = 20
levLayer PressPlateLayer = 45
@@ -38,3 +32,4 @@ levLayer ShadowLayer = 75
levLayer LabelLayer = 80
levLayer InvLayer = 85
levLayer MenuDepth = 90
levLayer DebugLayer = 99
+1
View File
@@ -16,3 +16,4 @@ data Layer
| UPtLayer
| HPtLayer
| GloomLayer
| DebugLayer