From 779c858a2ce1c741a1b572704e7a23902fae2b2a Mon Sep 17 00:00:00 2001 From: jgk Date: Sun, 21 Mar 2021 13:43:23 +0100 Subject: [PATCH] Make windows render over walls --- src/Dodge/Rendering.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Dodge/Rendering.hs b/src/Dodge/Rendering.hs index 9797d0333..e2583f9db 100644 --- a/src/Dodge/Rendering.hs +++ b/src/Dodge/Rendering.hs @@ -27,10 +27,8 @@ import qualified Data.Set as S -- }}} fixedCoordPictures :: World -> Picture fixedCoordPictures w = pictures --- [ scaler $ onLayer LabelLayer $ pictures [ppLabels, btLabels] [ scaler $ hudDrawings w , scaler $ onLayer MenuLayer menuScreen - --, onLayer InvLayer $ activeObjectText w , onLayer InvLayer $ closeObjectTexts w ] where scaler = scale (2 / _windowX w) (2 / _windowY w) @@ -57,7 +55,6 @@ fixedCoordPictures w = pictures ] where tst x y sc t = translate x y $ scale sc sc $ color white $ text t - worldPictures :: World -> Picture worldPictures w = pictures $ concat [ decPicts @@ -87,7 +84,7 @@ worldPictures w clPicts = map clDraw $ IM.elems $ _clouds w smokeShadows = map (drawSmokeShadow w) $ _smoke w wlPicts = map drawWallFloor (wallFloorsToDraw w) - wlPicts' = map (drawWall w) (wallShadowsToDraw w) + wlPicts' = map (drawWallFace w) (wallShadowsToDraw w) itFloorPicts = map drawItem (IM.elems (_floorItems w)) yourPos = _crPos $ you w yourRot = _crDir $ you w @@ -307,16 +304,16 @@ lineOnScreen w (p1:p2:_) = errorPointInPolygon 8 p1 sp || errorPointInPolygon 9 where sp = screenPolygon w sps = zip sp (tail sp ++ [head sp]) -drawWall :: World -> Wall -> Drawing -drawWall w wall +drawWallFace :: World -> Wall -> Drawing +drawWallFace w wall | isRHS sightFrom x y = blank | otherwise = colorAndLayer $ polygon $ points where colorAndLayer | _wlIsSeeThrough wall = setLayer 2 - . onLayerL [levLayer ShadowLayer] + . onLayerL [levLayer ShadowLayer,2] . color (withAlpha 0.2 $ _wlColor wall) | otherwise = setLayer 2 - . onLayerL [levLayer ShadowLayer,2] + . onLayerL [levLayer ShadowLayer] . color (_wlColor wall) (x:y:_) = _wlLine wall ps = linePointsBetween x y