Restrict some arguments

This commit is contained in:
2022-10-28 22:00:38 +01:00
parent d496c4c523
commit 14e2b5cf8f
6 changed files with 55 additions and 53 deletions
+5 -5
View File
@@ -276,7 +276,7 @@ drawFarWallDetect w =
, fst $ collidePoint p q $ filter wlIsOpaque $ wlsNearSeg p q w
]
)
$ getViewpoints p w
$ getViewpoints p (_cWorld w)
-- $ runIdentity $ S.toList_ $ streamViewpoints p w
where
p = w ^. cWorld . lWorld . camPos . camViewFrom
@@ -411,8 +411,8 @@ drawPathing cfig w =
dispInc (p, n) = setDepth 2 . uncurryV translate p . scale 0.1 0.1 $ text $ show n
gr = w ^. cWorld . lWorld . pathGraph
crDisplayInfo :: Configuration -> World -> Creature -> Maybe (Point2, [String])
crDisplayInfo cfig w cr
crDisplayInfo :: Configuration -> CamPos -> Creature -> Maybe (Point2, [String])
crDisplayInfo cfig cam cr
| _crID cr == 0 = Nothing
| crOnScreen =
Just
@@ -431,7 +431,7 @@ crDisplayInfo cfig w cr
| otherwise = Nothing
where
ap = _crActionPlan cr
crOnScreen = pointOnScreen cfig (w ^. cWorld . lWorld . camPos) $ _crPos cr
crOnScreen = pointOnScreen cfig cam $ _crPos cr
fpreShow :: (Show a, Functor f) => String -> f a -> f String
fpreShow str = fmap (((rightPad 7 '.' str ++ "...") ++) . show)
@@ -440,7 +440,7 @@ drawCrInfo :: Configuration -> World -> Picture
drawCrInfo cfig w =
setLayer FixedCoordLayer $
renderInfoListsAt (2 * hw - 400) 0 cfig w $
mapMaybe (crDisplayInfo cfig w) $ IM.elems $ w ^. cWorld . lWorld . creatures
mapMaybe (crDisplayInfo cfig (w ^. cWorld . lWorld . camPos)) $ IM.elems $ w ^. cWorld . lWorld . creatures
where
hw = halfWidth cfig
+2 -1
View File
@@ -25,7 +25,8 @@ wallsToDraw w =
<*> L.prefilter wlSeeThroughDraw (L.premap f L.list)
<*> L.premap getWallSPic L.mconcat
)
(wlsFromIXs w $ zonesExtract (w ^. cWorld . lWorld . wlZoning) $ zoneOfSight wlZoneSize w)
(wlsFromIXs w $ zonesExtract (w ^. cWorld . lWorld . wlZoning) $ zoneOfSight wlZoneSize cam)
cam = w ^. cWorld . lWorld . camPos
--wallsToDraw
-- :: World