Fix laser targeting draw when creature offscreen
This commit is contained in:
@@ -25,6 +25,7 @@ import qualified Data.Map.Strict as M
|
||||
--import Control.Lens
|
||||
--import Data.Maybe
|
||||
|
||||
-- TODO only filter out shapes outside the range of the furthest shown light source
|
||||
worldSPic :: Configuration -> World -> SPic
|
||||
worldSPic cfig w =
|
||||
(extraShapes w, extraPics cfig w)
|
||||
@@ -35,13 +36,13 @@ worldSPic cfig w =
|
||||
<> foldMap mcSPic (filtOn _mcPos _machines)
|
||||
where
|
||||
filtOn f g = IM.filter (pointIsClose . f) (g w)
|
||||
pointIsClose p = dist camCen p < winSize
|
||||
winSize = 30 + max (_windowX cfig) (_windowY cfig)
|
||||
pointIsClose p = dist camCen p < 30 + _viewDistance w
|
||||
camCen = _cameraCenter w
|
||||
|
||||
extraShapes :: World -> Shape
|
||||
extraShapes = _foregroundShape
|
||||
|
||||
-- TODO filter out pictures not in the frame
|
||||
extraPics :: Configuration -> World -> Picture
|
||||
extraPics cfig w = pictures (_decorations w)
|
||||
<> concatMapPic (dbArg _ptDraw) (_particles w)
|
||||
@@ -53,7 +54,6 @@ extraPics cfig w = pictures (_decorations w)
|
||||
<> viewBoundaries cfig w
|
||||
<> drawPathing cfig w
|
||||
|
||||
-- TODO remove duplicate!
|
||||
testPic :: World -> Picture
|
||||
testPic _ = []
|
||||
clDraw :: Cloud -> Picture
|
||||
@@ -73,7 +73,7 @@ mcSPic bt = uncurryV translateSPf (_mcPos bt)
|
||||
$ rotateSP (_mcDir bt) (_mcDraw bt bt)
|
||||
|
||||
soundPics :: Configuration -> World -> Picture
|
||||
soundPics cfig w
|
||||
soundPics cfig w
|
||||
| _show_sound cfig = pictures $ M.map (soundPic cfig w) $ _playingSounds w
|
||||
| otherwise = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user