Continue refactor
This commit is contained in:
@@ -5,7 +5,7 @@ import Dodge.Creature.HandPos
|
|||||||
--import Dodge.Particle.TeslaArc
|
--import Dodge.Particle.TeslaArc
|
||||||
--import Dodge.SoundLogic.LoadSound
|
--import Dodge.SoundLogic.LoadSound
|
||||||
--import Dodge.WorldEvent
|
--import Dodge.WorldEvent
|
||||||
import Dodge.WorldEvent.ThingsHit
|
--import Dodge.WorldEvent.ThingsHit
|
||||||
--import Dodge.Default
|
--import Dodge.Default
|
||||||
--import Dodge.Item.Weapon.InventoryDisplay
|
--import Dodge.Item.Weapon.InventoryDisplay
|
||||||
import Dodge.Item.Weapon.TriggerType
|
import Dodge.Item.Weapon.TriggerType
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import Picture
|
|||||||
import Geometry
|
import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
import Data.Maybe
|
|
||||||
import qualified Data.IntMap.Strict as IM
|
import qualified Data.IntMap.Strict as IM
|
||||||
import qualified Streaming.Prelude as S
|
import qualified Streaming.Prelude as S
|
||||||
{- | Creates an outwardly increasing circle that draws creatures, even those behind walls. -}
|
{- | Creates an outwardly increasing circle that draws creatures, even those behind walls. -}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ addBlock (p:ps) wl bl w = w
|
|||||||
V2 x y = wallZoneOfPoint $ uncurry midPoint (_wlLine wl)
|
V2 x y = wallZoneOfPoint $ uncurry midPoint (_wlLine wl)
|
||||||
wlid = _wlID wl
|
wlid = _wlID wl
|
||||||
ips = map (unv2 . wallZoneOfPoint) $ uncurry (divideLine (2*wallZoneSize)) (_wlLine wl)
|
ips = map (unv2 . wallZoneOfPoint) $ uncurry (divideLine (2*wallZoneSize)) (_wlLine wl)
|
||||||
unv2 (V2 x y) = (x,y)
|
unv2 (V2 x' y') = (x',y')
|
||||||
addBlock _ _ _ _ = error "Trying to add a block with incomplete polygon"
|
addBlock _ _ _ _ = error "Trying to add a block with incomplete polygon"
|
||||||
|
|
||||||
placeBlock :: [Point2] -> Block -> Wall -> World -> (Int,World)
|
placeBlock :: [Point2] -> Block -> Wall -> World -> (Int,World)
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ doDrawing pdata u = do
|
|||||||
trans = _cameraCenter w
|
trans = _cameraCenter w
|
||||||
wins@(V2 winx winy) = V2 (_windowX cfig) (_windowY cfig)
|
wins@(V2 winx winy) = V2 (_windowX cfig) (_windowY cfig)
|
||||||
resFact = resFactorNum $ cfig ^. graphics_resolution_factor
|
resFact = resFactorNum $ cfig ^. graphics_resolution_factor
|
||||||
(wallPointsCol,windowPoints,wallSPics) = wallsToDrawStreams cfig w
|
(wallPointsCol,windowPoints,wallSPics) = wallsToDraw w
|
||||||
lightPoints = lightsToRender cfig w
|
lightPoints = lightsToRender cfig w
|
||||||
viewFroms@(V2 vfx vfy) = _cameraViewFrom w
|
viewFroms@(V2 vfx vfy) = _cameraViewFrom w
|
||||||
viewFrom3d = Vector3 vfx vfy 20
|
viewFrom3d = Vector3 vfx vfy 20
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Dodge.Render.Walls
|
module Dodge.Render.Walls
|
||||||
( wallsToDrawStreams
|
( wallsToDraw
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Zone
|
import Dodge.Zone
|
||||||
@@ -13,11 +13,10 @@ import qualified Control.Foldl as L
|
|||||||
import qualified Streaming.Prelude as S
|
import qualified Streaming.Prelude as S
|
||||||
--import Data.List
|
--import Data.List
|
||||||
--import qualified Data.IntMap.Strict as IM
|
--import qualified Data.IntMap.Strict as IM
|
||||||
wallsToDrawStreams
|
wallsToDraw
|
||||||
:: Configuration
|
:: World
|
||||||
-> World
|
|
||||||
-> ( [((Point2,Point2),Point4)] ,[((Point2,Point2),Point4)], SPic )
|
-> ( [((Point2,Point2),Point4)] ,[((Point2,Point2),Point4)], SPic )
|
||||||
wallsToDrawStreams cfig w
|
wallsToDraw w
|
||||||
= ( wls, wins,spic)
|
= ( wls, wins,spic)
|
||||||
where
|
where
|
||||||
f wl = (_wlLine wl, _wlColor wl)
|
f wl = (_wlLine wl, _wlColor wl)
|
||||||
|
|||||||
@@ -57,18 +57,12 @@ thingsHitExceptCr (Just cid) sp ep = S.filter crNotCid . thingsHit sp ep
|
|||||||
crNotCid (_,Left cr) = _crID cr /= cid
|
crNotCid (_,Left cr) = _crID cr /= cid
|
||||||
crNotCid _ = True
|
crNotCid _ = True
|
||||||
|
|
||||||
--wallsHit
|
wallsHit
|
||||||
-- :: Point2 -- ^ Line start point
|
:: Point2 -- ^ Line start point
|
||||||
-- -> Point2 -- ^ Line end point
|
-> Point2 -- ^ Line end point
|
||||||
-- -> World
|
-> World
|
||||||
-- -> [(Point2, Wall)]
|
-> Stream (Of (Point2, Wall)) Identity ()
|
||||||
--wallsHit sp ep w
|
wallsHit sp ep w
|
||||||
-- | sp == ep = []
|
| sp == ep = S.each []
|
||||||
-- | otherwise = sortOn (dist sp . fst) wls
|
| otherwise = sortStreamOn (dist sp . fst)
|
||||||
-- where
|
. overlapSegWalls sp ep $ wallsAlongLine sp ep w
|
||||||
-- wls = IM.elems $ wallsOnLineHit sp ep
|
|
||||||
-- $ IM.unions [f b $ f a $ _znObjects $ _wallsZone w
|
|
||||||
-- | a<-[x-1,x,x+1] , b<-[y-1,y,y+1]]
|
|
||||||
-- -- $ _walls w
|
|
||||||
-- V2 x y = wallZoneOfPoint (0.5 *.* (sp +.+ ep))
|
|
||||||
-- f i = fromMaybe IM.empty . IM.lookup i
|
|
||||||
|
|||||||
+1
-1
@@ -7,6 +7,7 @@ module Dodge.Zone
|
|||||||
, lookLookups
|
, lookLookups
|
||||||
, zoneOfSeg
|
, zoneOfSeg
|
||||||
, zoneNearPointIP
|
, zoneNearPointIP
|
||||||
|
, zoneNearPoint
|
||||||
, cloudZoneOfPoint
|
, cloudZoneOfPoint
|
||||||
, cloudsNearPoint
|
, cloudsNearPoint
|
||||||
, wallsNearZones
|
, wallsNearZones
|
||||||
@@ -34,7 +35,6 @@ import Data.Maybe
|
|||||||
import Data.List
|
import Data.List
|
||||||
--import Data.IntMap.Merge.Strict
|
--import Data.IntMap.Merge.Strict
|
||||||
import qualified Data.IntMap.Strict as IM
|
import qualified Data.IntMap.Strict as IM
|
||||||
import qualified Data.IntSet as IS
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
|
||||||
--flattenZones :: Zone (IM.IntMap a) -> IM.IntMap a
|
--flattenZones :: Zone (IM.IntMap a) -> IM.IntMap a
|
||||||
|
|||||||
Reference in New Issue
Block a user