diff --git a/src/Dodge/Render/Shape.hs b/src/Dodge/Render/Shape.hs index 8f7eaaf76..1cf00baff 100644 --- a/src/Dodge/Render/Shape.hs +++ b/src/Dodge/Render/Shape.hs @@ -11,19 +11,12 @@ import Dodge.Render.ShapePicture import qualified Data.IntMap as IM worldShape :: World -> Shape worldShape w = _foregroundShape w - <> mconcat (map (crShape w) (IM.elems $ IM.filter crIsClose (_creatures w))) - <> mconcat (map (_spShape . floorItemSPic) $ IM.elems $ _floorItems w) + <> mconcat (map (crShape w) (IM.elems $ IM.filter (pointIsClose . _crPos) (_creatures w))) + <> mconcat (map (_spShape . floorItemSPic) $ IM.elems $ IM.filter (pointIsClose . _flItPos) $ _floorItems w) where - crIsClose cr = dist (_crPos cr) camCen < winSize + pointIsClose p = dist camCen p < winSize winSize = 30 + max (getWindowX w) (getWindowY w) camCen = _cameraCenter w -pointIsClose :: World -> Point2 -> Bool -pointIsClose w p = dist p camCen < winSize - where - winSize = 30 + max (getWindowX w) (getWindowY w) - camCen = _cameraCenter w - - crShape :: World -> Creature -> Shape crShape w c = _spShape $ _crPict c c w diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index e7f33204b..e80476e3a 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -5,6 +5,7 @@ import Geometry import ShapePicture floorItemSPic :: FloorItem -> SPic -floorItemSPic flit = uncurryV translateSPf (_flItPos flit) - $ rotateSP (_flItRot flit) (_itFloorPict (_flIt flit)) +floorItemSPic flit + = uncurryV translateSPf (_flItPos flit) + $ rotateSP (_flItRot flit) (_itFloorPict (_flIt flit))