Replace PutShape with PutForeground

This commit is contained in:
2022-06-27 14:30:08 +01:00
parent fec72cdf48
commit 0def31895f
11 changed files with 39 additions and 55 deletions
+9 -8
View File
@@ -16,6 +16,7 @@ import Geometry
--import Geometry.ConvexPoly
import Dodge.GameRoom
import LensHelp
import Bound
import qualified Data.Map.Strict as M
--import qualified Data.List.NonEmpty as NEL
@@ -28,7 +29,6 @@ import qualified Data.IntMap.Strict as IM
import qualified SDL
--import Data.Monoid
--import Data.Semigroup
import qualified Control.Foldl as L
import qualified Streaming.Prelude as S
import Streaming
{- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers;
@@ -219,13 +219,14 @@ gameRoomViewpoints p gr = S.each (_grViewpoints gr)
extend outp = p +.+ maxViewDistance *.* squashNormalizeV (outp -.- p)
addDir a = p +.+ unitVectorAtAngle a
farWallDistDirection :: Point2 -> World -> (Maybe Float,Maybe Float,Maybe Float,Maybe Float)
farWallDistDirection p w = runIdentity $ L.purely S.fold_ ((,,,)
<$> L.premap (^?! _2) L.maximum
<*> L.premap (^?! _2) L.minimum
<*> L.premap (^?! _1) L.maximum
<*> L.premap (^?! _1) L.minimum
)
farWallDistDirection :: Point2 -> World -> Maybe (Float,Float,Float,Float)
farWallDistDirection p w = boundPoints
-- runIdentity $ L.purely S.fold_ ((,,,)
-- <$> L.premap (^?! _2) L.maximum
-- <*> L.premap (^?! _2) L.minimum
-- <*> L.premap (^?! _1) L.maximum
-- <*> L.premap (^?! _1) L.minimum
-- )
$ S.map f vps
where
f q = runIdentity (S.fold_ findPoint q (rotateV (negate $ _cameraRot w) . (-.- p)) (wls q))