Cleanup
This commit is contained in:
+2
-2
@@ -33,8 +33,8 @@ splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardC
|
|||||||
unshadowBlock :: Int -> World -> World
|
unshadowBlock :: Int -> World -> World
|
||||||
unshadowBlock wlid w = case w ^? walls . ix wlid of
|
unshadowBlock wlid w = case w ^? walls . ix wlid of
|
||||||
Just wl -> w
|
Just wl -> w
|
||||||
& walls . ix wlid . wlDraw .~ True
|
& walls . ix wlid . wlUnshadowed .~ True
|
||||||
& wlZoning . znObjects . ix x . ix y . ix wlid . wlDraw .~ True
|
& wlZoning . znObjects . ix x . ix y . ix wlid . wlUnshadowed .~ True
|
||||||
where
|
where
|
||||||
V2 x y = wlZoneOfPoint $ uncurry midPoint (_wlLine wl)
|
V2 x y = wlZoneOfPoint $ uncurry midPoint (_wlLine wl)
|
||||||
Nothing -> w
|
Nothing -> w
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ data Wall
|
|||||||
= Wall
|
= Wall
|
||||||
{ _wlLine :: [Point2] , _wlID :: Int
|
{ _wlLine :: [Point2] , _wlID :: Int
|
||||||
, _wlColor :: Color
|
, _wlColor :: Color
|
||||||
, _wlDraw :: Maybe (Wall -> Picture)
|
, _wlUnshadowed :: Maybe (Wall -> Picture)
|
||||||
, _wlSeen :: Bool
|
, _wlSeen :: Bool
|
||||||
, _wlIsSeeThrough :: Bool
|
, _wlIsSeeThrough :: Bool
|
||||||
}
|
}
|
||||||
@@ -552,7 +552,7 @@ data Wall
|
|||||||
, _wlID :: Int
|
, _wlID :: Int
|
||||||
, _doorMech :: World -> World
|
, _doorMech :: World -> World
|
||||||
, _wlColor :: Color
|
, _wlColor :: Color
|
||||||
, _wlDraw :: Maybe (Wall -> Picture)
|
, _wlUnshadowed :: Maybe (Wall -> Picture)
|
||||||
, _wlSeen :: Bool
|
, _wlSeen :: Bool
|
||||||
, _blIDs :: [Int]
|
, _blIDs :: [Int]
|
||||||
, _blHP :: Int
|
, _blHP :: Int
|
||||||
@@ -562,7 +562,7 @@ data Wall
|
|||||||
{ _wlLine :: [Point2] , _wlID :: Int
|
{ _wlLine :: [Point2] , _wlID :: Int
|
||||||
, _doorMech :: World -> World
|
, _doorMech :: World -> World
|
||||||
, _wlColor :: Color
|
, _wlColor :: Color
|
||||||
, _wlDraw :: Maybe (Wall -> Picture)
|
, _wlUnshadowed :: Maybe (Wall -> Picture)
|
||||||
, _wlSeen :: Bool
|
, _wlSeen :: Bool
|
||||||
, _wlIsSeeThrough :: Bool
|
, _wlIsSeeThrough :: Bool
|
||||||
, _doorPathable :: Bool
|
, _doorPathable :: Bool
|
||||||
@@ -571,7 +571,7 @@ data Wall
|
|||||||
{ _wlLine :: [Point2]
|
{ _wlLine :: [Point2]
|
||||||
, _wlID :: Int
|
, _wlID :: Int
|
||||||
, _wlColor :: Color
|
, _wlColor :: Color
|
||||||
, _wlDraw :: Maybe (Wall -> Picture)
|
, _wlUnshadowed :: Maybe (Wall -> Picture)
|
||||||
, _wlSeen :: Bool
|
, _wlSeen :: Bool
|
||||||
, _blIDs :: [Int]
|
, _blIDs :: [Int]
|
||||||
, _blHP :: Int
|
, _blHP :: Int
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ data Wall = Wall
|
|||||||
, _wlTouchThrough :: Bool
|
, _wlTouchThrough :: Bool
|
||||||
, _wlFireThrough :: Bool
|
, _wlFireThrough :: Bool
|
||||||
, _wlReflect :: Bool
|
, _wlReflect :: Bool
|
||||||
, _wlDraw :: Bool
|
, _wlUnshadowed :: Bool
|
||||||
, _wlRotateTo :: Bool
|
, _wlRotateTo :: Bool
|
||||||
, _wlStructure :: WallStructure
|
, _wlStructure :: WallStructure
|
||||||
, _wlHeight :: Float
|
, _wlHeight :: Float
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ defaultWall = Wall
|
|||||||
, _wlFireThrough = False
|
, _wlFireThrough = False
|
||||||
, _wlTouchThrough = False
|
, _wlTouchThrough = False
|
||||||
, _wlReflect = False
|
, _wlReflect = False
|
||||||
, _wlDraw = True
|
, _wlUnshadowed = True
|
||||||
, _wlRotateTo = True
|
, _wlRotateTo = True
|
||||||
, _wlStructure = StandaloneWall
|
, _wlStructure = StandaloneWall
|
||||||
, _wlWalkable = False
|
, _wlWalkable = False
|
||||||
@@ -38,7 +38,7 @@ defaultCrystalWall = defaultWall
|
|||||||
defaultMachineWall :: Wall
|
defaultMachineWall :: Wall
|
||||||
defaultMachineWall = defaultWall
|
defaultMachineWall = defaultWall
|
||||||
{ _wlOpacity = SeeAbove
|
{ _wlOpacity = SeeAbove
|
||||||
, _wlDraw = False
|
, _wlUnshadowed = False
|
||||||
, _wlRotateTo = False
|
, _wlRotateTo = False
|
||||||
, _wlStructure = MachinePart 0
|
, _wlStructure = MachinePart 0
|
||||||
, _wlMaterial = Metal
|
, _wlMaterial = Metal
|
||||||
@@ -51,7 +51,7 @@ defaultDirtWall = defaultWall
|
|||||||
, _wlSeen = False
|
, _wlSeen = False
|
||||||
, _wlOpacity = Opaque
|
, _wlOpacity = Opaque
|
||||||
, _wlRotateTo = False
|
, _wlRotateTo = False
|
||||||
, _wlDraw = True
|
, _wlUnshadowed = True
|
||||||
, _wlFireThrough = True
|
, _wlFireThrough = True
|
||||||
, _wlMaterial = Dirt
|
, _wlMaterial = Dirt
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ defaultWindow = defaultWall
|
|||||||
, _wlColor = withAlpha 0.5 cyan
|
, _wlColor = withAlpha 0.5 cyan
|
||||||
, _wlSeen = False
|
, _wlSeen = False
|
||||||
, _wlOpacity = SeeThrough
|
, _wlOpacity = SeeThrough
|
||||||
, _wlDraw = True
|
, _wlUnshadowed = True
|
||||||
, _wlFireThrough = True
|
, _wlFireThrough = True
|
||||||
, _wlMaterial = Glass
|
, _wlMaterial = Glass
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ flatShield = defaultEquipment
|
|||||||
, _aimRange = 0
|
, _aimRange = 0
|
||||||
, _aimZoom = ItZoom 20 0.2 1
|
, _aimZoom = ItZoom 20 0.2 1
|
||||||
, _aimStance = TwoHandFlat
|
, _aimStance = TwoHandFlat
|
||||||
, _aimHandlePos = 10
|
, _aimHandlePos = 0
|
||||||
, _aimMuzPos = 10
|
, _aimMuzPos = 0
|
||||||
}
|
}
|
||||||
, _heldScroll = \_ _ -> id
|
, _heldScroll = \_ _ -> id
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ shieldWall crid = defaultWall
|
|||||||
,_wlWalkable = True
|
,_wlWalkable = True
|
||||||
,_wlFireThrough = True
|
,_wlFireThrough = True
|
||||||
,_wlReflect = True
|
,_wlReflect = True
|
||||||
,_wlDraw = False
|
,_wlUnshadowed = False
|
||||||
,_wlRotateTo = False
|
,_wlRotateTo = False
|
||||||
,_wlStructure = CreaturePart crid -- shieldWallDamage
|
,_wlStructure = CreaturePart crid -- shieldWallDamage
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import Data.Tuple
|
|||||||
reflectLaserAlong :: Float -> Point2 -> Point2 -> World
|
reflectLaserAlong :: Float -> Point2 -> Point2 -> World
|
||||||
-> (Maybe (Point2,Either Creature Wall),[Point2])
|
-> (Maybe (Point2,Either Creature Wall),[Point2])
|
||||||
{-# INLINE reflectLaserAlong #-}
|
{-# INLINE reflectLaserAlong #-}
|
||||||
reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlDraw sp ep w of
|
reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlUnshadowed sp ep w of
|
||||||
Just (p,Right wl)
|
Just (p,Right wl)
|
||||||
| _wlReflect wl -> second (p:) $ reflectLaserAlong phasev
|
| _wlReflect wl -> second (p:) $ reflectLaserAlong phasev
|
||||||
(p +.+ unitVectorAtAngle (reflDirWall sp p wl))
|
(p +.+ unitVectorAtAngle (reflDirWall sp p wl))
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ lowBlock mat col h ps = PutBlock bl wl $ reverse ps
|
|||||||
& blDraw .~ const (noPic $ colorSH col (upperPrismPoly h $ reverse ps))
|
& blDraw .~ const (noPic $ colorSH col (upperPrismPoly h $ reverse ps))
|
||||||
& blDeath .~ const id
|
& blDeath .~ const id
|
||||||
wl = defaultWall
|
wl = defaultWall
|
||||||
& wlDraw .~ False
|
& wlUnshadowed .~ False
|
||||||
& wlColor .~ col
|
& wlColor .~ col
|
||||||
& wlRotateTo .~ False
|
& wlRotateTo .~ False
|
||||||
& wlOpacity .~ SeeAbove
|
& wlOpacity .~ SeeAbove
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ tankShape baseshape facade col col'
|
|||||||
& blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col')
|
& blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col')
|
||||||
& blDeath .~ const id
|
& blDeath .~ const id
|
||||||
wl = defaultWall
|
wl = defaultWall
|
||||||
& wlDraw .~ False
|
& wlUnshadowed .~ False
|
||||||
& wlColor .~ col
|
& wlColor .~ col
|
||||||
& wlRotateTo .~ False
|
& wlRotateTo .~ False
|
||||||
& wlOpacity .~ SeeAbove
|
& wlOpacity .~ SeeAbove
|
||||||
@@ -38,7 +38,7 @@ tankShape baseshape facade col col'
|
|||||||
-- = ps0jPushPS
|
-- = ps0jPushPS
|
||||||
-- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
|
-- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
|
||||||
-- $ sps0 $ PutWall baseshape defaultWall
|
-- $ sps0 $ PutWall baseshape defaultWall
|
||||||
-- {_wlDraw = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
|
-- {_wlUnshadowed = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
|
||||||
|
|
||||||
roundTank :: Color -> Color -> Placement
|
roundTank :: Color -> Color -> Placement
|
||||||
roundTank = tankShape (polyCirc 4 20)
|
roundTank = tankShape (polyCirc 4 20)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ heightWallPS spot h ps = spNoID spot $ lowBlock Stone (_wlColor defaultWall) h p
|
|||||||
invisibleWall :: [Point2] -> Placement
|
invisibleWall :: [Point2] -> Placement
|
||||||
invisibleWall ps = sps0 $ PutWall ps $ defaultWall
|
invisibleWall ps = sps0 $ PutWall ps $ defaultWall
|
||||||
{ _wlOpacity = SeeAbove
|
{ _wlOpacity = SeeAbove
|
||||||
, _wlDraw = False
|
, _wlUnshadowed = False
|
||||||
, _wlHeight = 0
|
, _wlHeight = 0
|
||||||
, _wlTouchThrough = True
|
, _wlTouchThrough = True
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ baseBlockPane = defaultWall
|
|||||||
, _wlColor = greyN 0.5
|
, _wlColor = greyN 0.5
|
||||||
, _wlSeen = False
|
, _wlSeen = False
|
||||||
, _wlOpacity = Opaque
|
, _wlOpacity = Opaque
|
||||||
, _wlDraw = True
|
, _wlUnshadowed = True
|
||||||
, _wlFireThrough = True
|
, _wlFireThrough = True
|
||||||
}
|
}
|
||||||
-- TODO find home for this
|
-- TODO find home for this
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ plLineBlock basePane blwidth a b gw = ( 0
|
|||||||
{_wlID = k
|
{_wlID = k
|
||||||
,_wlStructure = BlockPart $ i + blid
|
,_wlStructure = BlockPart $ i + blid
|
||||||
,_wlLine = ps
|
,_wlLine = ps
|
||||||
,_wlDraw = visStatus
|
,_wlUnshadowed = visStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Must be done after inserting the block
|
-- | Must be done after inserting the block
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ plLineBlock basePane blwidth a b gw = ( 0
|
|||||||
{_wlID = k
|
{_wlID = k
|
||||||
,_wlStructure = BlockPart $ i + blid
|
,_wlStructure = BlockPart $ i + blid
|
||||||
,_wlLine = ps
|
,_wlLine = ps
|
||||||
,_wlDraw = visStatus
|
,_wlUnshadowed = visStatus
|
||||||
}
|
}
|
||||||
listWalls = concat $ zipWith makeWallAt blockCenPs is
|
listWalls = concat $ zipWith makeWallAt blockCenPs is
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ viewClipBounds cfig w
|
|||||||
-- where
|
-- where
|
||||||
-- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall
|
-- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall
|
||||||
-- isVisible wl
|
-- isVisible wl
|
||||||
-- | wl ^? wlDraw == Just False = False
|
-- | wl ^? wlUnshadowed == Just False = False
|
||||||
-- | otherwise = onScreen wl
|
-- | otherwise = onScreen wl
|
||||||
--
|
--
|
||||||
--lineOnScreen :: World -> Point2 -> Point2 -> Bool
|
--lineOnScreen :: World -> Point2 -> Point2 -> Bool
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ viewClipBounds cfig w
|
|||||||
-- where
|
-- where
|
||||||
-- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall
|
-- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall
|
||||||
-- isVisible wl
|
-- isVisible wl
|
||||||
-- | wl ^? wlDraw == Just False = False
|
-- | wl ^? wlUnshadowed == Just False = False
|
||||||
-- | otherwise = onScreen wl
|
-- | otherwise = onScreen wl
|
||||||
--
|
--
|
||||||
--lineOnScreen :: World -> Point2 -> Point2 -> Bool
|
--lineOnScreen :: World -> Point2 -> Point2 -> Bool
|
||||||
|
|||||||
@@ -29,16 +29,16 @@ wallsToDraw w
|
|||||||
g (V2 i j) = w ^? wlZoning . znObjects . ix i . ix j
|
g (V2 i j) = w ^? wlZoning . znObjects . ix i . ix j
|
||||||
|
|
||||||
wlOpaqueDraw :: Wall -> Bool
|
wlOpaqueDraw :: Wall -> Bool
|
||||||
wlOpaqueDraw wl = wlIsOpaque wl && _wlDraw wl
|
wlOpaqueDraw wl = wlIsOpaque wl && _wlUnshadowed wl
|
||||||
wlSeeThroughDraw :: Wall -> Bool
|
wlSeeThroughDraw :: Wall -> Bool
|
||||||
wlSeeThroughDraw wl = wlIsSeeThrough wl && _wlDraw wl
|
wlSeeThroughDraw wl = wlIsSeeThrough wl && _wlUnshadowed wl
|
||||||
|
|
||||||
getWallSPic :: Wall -> SPic
|
getWallSPic :: Wall -> SPic
|
||||||
getWallSPic wl = case wl ^? wlOpacity . opDraw of
|
getWallSPic wl = case wl ^? wlOpacity . opDraw of
|
||||||
Nothing -> mempty
|
Nothing -> mempty
|
||||||
Just f -> f wl
|
Just f -> f wl
|
||||||
|
|
||||||
-- (wins,wls) = partition theTest . IM.elems . IM.filter _wlDraw $ wallsDoubleScreen cfig w
|
-- (wins,wls) = partition theTest . IM.elems . IM.filter _wlUnshadowed $ wallsDoubleScreen cfig w
|
||||||
-- theTest wl = case _wlOpacity wl of
|
-- theTest wl = case _wlOpacity wl of
|
||||||
-- Opaque -> False
|
-- Opaque -> False
|
||||||
-- _ -> True
|
-- _ -> True
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ forceField = defaultWall
|
|||||||
,_wlWalkable = True
|
,_wlWalkable = True
|
||||||
,_wlFireThrough = True
|
,_wlFireThrough = True
|
||||||
,_wlReflect = True
|
,_wlReflect = True
|
||||||
,_wlDraw = True
|
,_wlUnshadowed = True
|
||||||
,_wlRotateTo = False
|
,_wlRotateTo = False
|
||||||
,_wlStructure = StandaloneWall
|
,_wlStructure = StandaloneWall
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user