Improve speed of polygon rendering by folding tree type
This commit is contained in:
@@ -261,10 +261,10 @@ explosiveBarrel = basicCreature
|
||||
|
||||
equipOnTop :: (Creature -> Picture) -> Creature -> Drawing
|
||||
--equipOnTop f cr = onLayer CrLayer $ pictures $ fst (drawEquipment cr) ++ [f cr] ++ snd (drawEquipment cr)
|
||||
equipOnTop f cr = onLayer CrLayer (f cr) <> drawEquipment cr
|
||||
equipOnTop f cr = pictures [onLayer CrLayer (f cr) , drawEquipment cr]
|
||||
|
||||
drawEquipment :: Creature -> Drawing
|
||||
drawEquipment cr = mconcat $ map f $ IM.toList (_crInv cr)
|
||||
drawEquipment cr = pictures $ map f $ IM.toList (_crInv cr)
|
||||
where f (i,it) = case it ^? itEquipPict of
|
||||
Just g -> g cr i
|
||||
_ -> blank
|
||||
@@ -388,7 +388,7 @@ sizeEnemy col cr
|
||||
sizeColEnemy r col = pictures [color col $ circleSolid r, circLine r]
|
||||
|
||||
basicCrPict :: Color -> Creature -> Drawing
|
||||
basicCrPict col cr = onLayer CrLayer naked <> drawEquipment cr
|
||||
basicCrPict col cr = pictures [ onLayer CrLayer naked , drawEquipment cr]
|
||||
where naked | pdam > 200 = color red $ circleSolid $ _crRad cr
|
||||
| pdam > 100 = color white $ circleSolid $ _crRad cr
|
||||
| mod pdam 2 == 1 = color white $ circleSolid $ _crRad cr
|
||||
|
||||
Reference in New Issue
Block a user