Further strictifying

This commit is contained in:
2021-07-30 00:23:02 +02:00
parent bd8ef3f416
commit 2d8b27746c
33 changed files with 228 additions and 211 deletions
+6 -6
View File
@@ -33,7 +33,7 @@ basicCrPict col cr w
targetingPic ++
[ tr . setDepth 0 $ color yellow $ circleSolid 10
, tr . piercingMod $ bluntScale $ naked col cr
, tr $ torso (light4 col) (0,-crad) (0,crad)
, tr $ torso (light4 col) (V2 (0) (-crad)) (V2 0 crad)
, trFeet $ feet cr
, tr $ arms col cr
, tr $ drawEquipment cr
@@ -42,8 +42,8 @@ basicCrPict col cr w
crad = _crRad cr
targetingPic = IM.elems $ IM.mapMaybeWithKey f $ _crInv cr
f invid it = fmap ((\g -> g invid it cr w) . snd) (it ^? itTargeting . _Just)
tr = uncurry translate (_crPos cr) . rotate (_crDir cr)
trFeet = uncurry translate (_crPos cr) . rotate (_crMvDir cr)
tr = uncurryV translate (_crPos cr) . rotate (_crDir cr)
trFeet = uncurryV translate (_crPos cr) . rotate (_crMvDir cr)
cdir = _crDir cr
bluntDam :: Maybe Point2
bluntDam = find isBluntDam (concat pastDams) >>= (\dm -> (-.-) <$> dm ^? dmFrom <*> dm ^? dmTo)
@@ -104,7 +104,7 @@ arms col cr
torso :: Color -> Point2 -> Point2 -> Picture
torso col x y = color col $ pictures
[ poly3 [addZ 20 x, addZ 12 v, addZ 12 ((0,0) -.- v), addZ 20 y]
[ poly3 [addZ 20 x, addZ 12 v, addZ 12 ((V2 0 0) -.- v), addZ 20 y]
, setDepth 12 . rotate a . scale 1 1 $ circleSolid $ magV v
]
where
@@ -171,8 +171,8 @@ drawEquipment cr = pictures $ map f $ IM.toList (_crInv cr)
_ -> blank
circLine :: Float -> Picture
circLine x = line [(0,0),(x,0)]
circLine x = line [(V2 0 0),(V2 x 0)]
picAtCrPos :: Picture -> Creature -> World -> Picture
{-# INLINE picAtCrPos #-}
picAtCrPos thePic cr _ = uncurry translate (_crPos cr) $ rotate (_crDir cr) thePic
picAtCrPos thePic cr _ = uncurryV translate (_crPos cr) $ rotate (_crDir cr) thePic