From 3447b9b0bb82035ba1cb356ba8950900996e6c9f Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 11 Jul 2022 10:26:33 +0100 Subject: [PATCH] Cleanup --- src/Dodge/Block.hs | 4 ++-- src/Dodge/Data.hs.orig | 8 ++++---- src/Dodge/Data/Wall.hs | 2 +- src/Dodge/Default/Wall.hs | 8 ++++---- src/Dodge/Item/Equipment.hs | 6 +++--- src/Dodge/Item/Weapon/LaserPath.hs | 2 +- src/Dodge/Placement/Instance/Block.hs | 2 +- src/Dodge/Placement/Instance/Tank.hs | 4 ++-- src/Dodge/Placement/Instance/Wall.hs | 4 ++-- src/Dodge/Placement/PlaceSpot/Block.hs | 2 +- src/Dodge/Placement/PlaceSpot/Block.hs.orig | 2 +- src/Dodge/Render/ShapePicture.hs | 2 +- src/Dodge/Render/ShapePicture.hs.orig | 2 +- src/Dodge/Render/Walls.hs | 6 +++--- src/Dodge/Wall/ForceField.hs | 2 +- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Dodge/Block.hs b/src/Dodge/Block.hs index 95a381911..c6198e74b 100644 --- a/src/Dodge/Block.hs +++ b/src/Dodge/Block.hs @@ -33,8 +33,8 @@ splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardC unshadowBlock :: Int -> World -> World unshadowBlock wlid w = case w ^? walls . ix wlid of Just wl -> w - & walls . ix wlid . wlDraw .~ True - & wlZoning . znObjects . ix x . ix y . ix wlid . wlDraw .~ True + & walls . ix wlid . wlUnshadowed .~ True + & wlZoning . znObjects . ix x . ix y . ix wlid . wlUnshadowed .~ True where V2 x y = wlZoneOfPoint $ uncurry midPoint (_wlLine wl) Nothing -> w diff --git a/src/Dodge/Data.hs.orig b/src/Dodge/Data.hs.orig index c34ac6e66..920530a6f 100644 --- a/src/Dodge/Data.hs.orig +++ b/src/Dodge/Data.hs.orig @@ -543,7 +543,7 @@ data Wall = Wall { _wlLine :: [Point2] , _wlID :: Int , _wlColor :: Color - , _wlDraw :: Maybe (Wall -> Picture) + , _wlUnshadowed :: Maybe (Wall -> Picture) , _wlSeen :: Bool , _wlIsSeeThrough :: Bool } @@ -552,7 +552,7 @@ data Wall , _wlID :: Int , _doorMech :: World -> World , _wlColor :: Color - , _wlDraw :: Maybe (Wall -> Picture) + , _wlUnshadowed :: Maybe (Wall -> Picture) , _wlSeen :: Bool , _blIDs :: [Int] , _blHP :: Int @@ -562,7 +562,7 @@ data Wall { _wlLine :: [Point2] , _wlID :: Int , _doorMech :: World -> World , _wlColor :: Color - , _wlDraw :: Maybe (Wall -> Picture) + , _wlUnshadowed :: Maybe (Wall -> Picture) , _wlSeen :: Bool , _wlIsSeeThrough :: Bool , _doorPathable :: Bool @@ -571,7 +571,7 @@ data Wall { _wlLine :: [Point2] , _wlID :: Int , _wlColor :: Color - , _wlDraw :: Maybe (Wall -> Picture) + , _wlUnshadowed :: Maybe (Wall -> Picture) , _wlSeen :: Bool , _blIDs :: [Int] , _blHP :: Int diff --git a/src/Dodge/Data/Wall.hs b/src/Dodge/Data/Wall.hs index acda83c46..66b723f75 100644 --- a/src/Dodge/Data/Wall.hs +++ b/src/Dodge/Data/Wall.hs @@ -19,7 +19,7 @@ data Wall = Wall , _wlTouchThrough :: Bool , _wlFireThrough :: Bool , _wlReflect :: Bool - , _wlDraw :: Bool + , _wlUnshadowed :: Bool , _wlRotateTo :: Bool , _wlStructure :: WallStructure , _wlHeight :: Float diff --git a/src/Dodge/Default/Wall.hs b/src/Dodge/Default/Wall.hs index e5d4262d2..a8165ef51 100644 --- a/src/Dodge/Default/Wall.hs +++ b/src/Dodge/Default/Wall.hs @@ -16,7 +16,7 @@ defaultWall = Wall , _wlFireThrough = False , _wlTouchThrough = False , _wlReflect = False - , _wlDraw = True + , _wlUnshadowed = True , _wlRotateTo = True , _wlStructure = StandaloneWall , _wlWalkable = False @@ -38,7 +38,7 @@ defaultCrystalWall = defaultWall defaultMachineWall :: Wall defaultMachineWall = defaultWall { _wlOpacity = SeeAbove - , _wlDraw = False + , _wlUnshadowed = False , _wlRotateTo = False , _wlStructure = MachinePart 0 , _wlMaterial = Metal @@ -51,7 +51,7 @@ defaultDirtWall = defaultWall , _wlSeen = False , _wlOpacity = Opaque , _wlRotateTo = False - , _wlDraw = True + , _wlUnshadowed = True , _wlFireThrough = True , _wlMaterial = Dirt } @@ -62,7 +62,7 @@ defaultWindow = defaultWall , _wlColor = withAlpha 0.5 cyan , _wlSeen = False , _wlOpacity = SeeThrough - , _wlDraw = True + , _wlUnshadowed = True , _wlFireThrough = True , _wlMaterial = Glass } diff --git a/src/Dodge/Item/Equipment.hs b/src/Dodge/Item/Equipment.hs index d1d0b684d..2d9bd2520 100644 --- a/src/Dodge/Item/Equipment.hs +++ b/src/Dodge/Item/Equipment.hs @@ -130,8 +130,8 @@ flatShield = defaultEquipment , _aimRange = 0 , _aimZoom = ItZoom 20 0.2 1 , _aimStance = TwoHandFlat - , _aimHandlePos = 10 - , _aimMuzPos = 10 + , _aimHandlePos = 0 + , _aimMuzPos = 0 } , _heldScroll = \_ _ -> id } @@ -153,7 +153,7 @@ shieldWall crid = defaultWall ,_wlWalkable = True ,_wlFireThrough = True ,_wlReflect = True - ,_wlDraw = False + ,_wlUnshadowed = False ,_wlRotateTo = False ,_wlStructure = CreaturePart crid -- shieldWallDamage } diff --git a/src/Dodge/Item/Weapon/LaserPath.hs b/src/Dodge/Item/Weapon/LaserPath.hs index 0b750de4b..fd361ca15 100644 --- a/src/Dodge/Item/Weapon/LaserPath.hs +++ b/src/Dodge/Item/Weapon/LaserPath.hs @@ -18,7 +18,7 @@ import Data.Tuple reflectLaserAlong :: Float -> Point2 -> Point2 -> World -> (Maybe (Point2,Either Creature Wall),[Point2]) {-# 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) | _wlReflect wl -> second (p:) $ reflectLaserAlong phasev (p +.+ unitVectorAtAngle (reflDirWall sp p wl)) diff --git a/src/Dodge/Placement/Instance/Block.hs b/src/Dodge/Placement/Instance/Block.hs index 08ef22540..89ec0e94b 100644 --- a/src/Dodge/Placement/Instance/Block.hs +++ b/src/Dodge/Placement/Instance/Block.hs @@ -15,7 +15,7 @@ lowBlock mat col h ps = PutBlock bl wl $ reverse ps & blDraw .~ const (noPic $ colorSH col (upperPrismPoly h $ reverse ps)) & blDeath .~ const id wl = defaultWall - & wlDraw .~ False + & wlUnshadowed .~ False & wlColor .~ col & wlRotateTo .~ False & wlOpacity .~ SeeAbove diff --git a/src/Dodge/Placement/Instance/Tank.hs b/src/Dodge/Placement/Instance/Tank.hs index 3238e5f59..f044c1c85 100644 --- a/src/Dodge/Placement/Instance/Tank.hs +++ b/src/Dodge/Placement/Instance/Tank.hs @@ -29,7 +29,7 @@ tankShape baseshape facade col col' & blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col') & blDeath .~ const id wl = defaultWall - & wlDraw .~ False + & wlUnshadowed .~ False & wlColor .~ col & wlRotateTo .~ False & wlOpacity .~ SeeAbove @@ -38,7 +38,7 @@ tankShape baseshape facade col col' -- = ps0jPushPS -- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col') -- $ 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 = tankShape (polyCirc 4 20) diff --git a/src/Dodge/Placement/Instance/Wall.hs b/src/Dodge/Placement/Instance/Wall.hs index 500dd0f37..dc014848f 100644 --- a/src/Dodge/Placement/Instance/Wall.hs +++ b/src/Dodge/Placement/Instance/Wall.hs @@ -18,7 +18,7 @@ heightWallPS spot h ps = spNoID spot $ lowBlock Stone (_wlColor defaultWall) h p invisibleWall :: [Point2] -> Placement invisibleWall ps = sps0 $ PutWall ps $ defaultWall { _wlOpacity = SeeAbove - , _wlDraw = False + , _wlUnshadowed = False , _wlHeight = 0 , _wlTouchThrough = True } @@ -85,7 +85,7 @@ baseBlockPane = defaultWall , _wlColor = greyN 0.5 , _wlSeen = False , _wlOpacity = Opaque - , _wlDraw = True + , _wlUnshadowed = True , _wlFireThrough = True } -- TODO find home for this diff --git a/src/Dodge/Placement/PlaceSpot/Block.hs b/src/Dodge/Placement/PlaceSpot/Block.hs index f7fd406f4..468e0ea66 100644 --- a/src/Dodge/Placement/PlaceSpot/Block.hs +++ b/src/Dodge/Placement/PlaceSpot/Block.hs @@ -91,7 +91,7 @@ plLineBlock basePane blwidth a b gw = ( 0 {_wlID = k ,_wlStructure = BlockPart $ i + blid ,_wlLine = ps - ,_wlDraw = visStatus + ,_wlUnshadowed = visStatus } -- | Must be done after inserting the block diff --git a/src/Dodge/Placement/PlaceSpot/Block.hs.orig b/src/Dodge/Placement/PlaceSpot/Block.hs.orig index aec26323e..fa8f565ec 100644 --- a/src/Dodge/Placement/PlaceSpot/Block.hs.orig +++ b/src/Dodge/Placement/PlaceSpot/Block.hs.orig @@ -105,7 +105,7 @@ plLineBlock basePane blwidth a b gw = ( 0 {_wlID = k ,_wlStructure = BlockPart $ i + blid ,_wlLine = ps - ,_wlDraw = visStatus + ,_wlUnshadowed = visStatus } listWalls = concat $ zipWith makeWallAt blockCenPs is diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index 74fe6dcf7..5f79acb25 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -388,7 +388,7 @@ viewClipBounds cfig w -- where -- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall -- isVisible wl --- | wl ^? wlDraw == Just False = False +-- | wl ^? wlUnshadowed == Just False = False -- | otherwise = onScreen wl -- --lineOnScreen :: World -> Point2 -> Point2 -> Bool diff --git a/src/Dodge/Render/ShapePicture.hs.orig b/src/Dodge/Render/ShapePicture.hs.orig index 87d34833c..423a191d3 100644 --- a/src/Dodge/Render/ShapePicture.hs.orig +++ b/src/Dodge/Render/ShapePicture.hs.orig @@ -367,7 +367,7 @@ viewClipBounds cfig w -- where -- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall -- isVisible wl --- | wl ^? wlDraw == Just False = False +-- | wl ^? wlUnshadowed == Just False = False -- | otherwise = onScreen wl -- --lineOnScreen :: World -> Point2 -> Point2 -> Bool diff --git a/src/Dodge/Render/Walls.hs b/src/Dodge/Render/Walls.hs index 1d13ca423..d2974a3f5 100644 --- a/src/Dodge/Render/Walls.hs +++ b/src/Dodge/Render/Walls.hs @@ -29,16 +29,16 @@ wallsToDraw w g (V2 i j) = w ^? wlZoning . znObjects . ix i . ix j wlOpaqueDraw :: Wall -> Bool -wlOpaqueDraw wl = wlIsOpaque wl && _wlDraw wl +wlOpaqueDraw wl = wlIsOpaque wl && _wlUnshadowed wl wlSeeThroughDraw :: Wall -> Bool -wlSeeThroughDraw wl = wlIsSeeThrough wl && _wlDraw wl +wlSeeThroughDraw wl = wlIsSeeThrough wl && _wlUnshadowed wl getWallSPic :: Wall -> SPic getWallSPic wl = case wl ^? wlOpacity . opDraw of Nothing -> mempty 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 -- Opaque -> False -- _ -> True diff --git a/src/Dodge/Wall/ForceField.hs b/src/Dodge/Wall/ForceField.hs index 76466e2a3..4e43ec8b9 100644 --- a/src/Dodge/Wall/ForceField.hs +++ b/src/Dodge/Wall/ForceField.hs @@ -13,7 +13,7 @@ forceField = defaultWall ,_wlWalkable = True ,_wlFireThrough = True ,_wlReflect = True - ,_wlDraw = True + ,_wlUnshadowed = True ,_wlRotateTo = False ,_wlStructure = StandaloneWall }