Cleanup
This commit is contained in:
@@ -25,7 +25,6 @@ import Dodge.Hammer
|
|||||||
import Dodge.ItEffect
|
import Dodge.ItEffect
|
||||||
import Dodge.Item.Grammar
|
import Dodge.Item.Grammar
|
||||||
import Dodge.Item.HeldOffset
|
import Dodge.Item.HeldOffset
|
||||||
import Dodge.LightSource
|
|
||||||
import Dodge.Prop.Gib
|
import Dodge.Prop.Gib
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import Dodge.Zoning.Creature
|
import Dodge.Zoning.Creature
|
||||||
|
|||||||
@@ -13,17 +13,6 @@ import Geometry
|
|||||||
data LightSourceDraw = DefaultLightSourceDraw
|
data LightSourceDraw = DefaultLightSourceDraw
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
--data TLSIntensity
|
|
||||||
-- = ConstantIntensity
|
|
||||||
-- | TLSFade Point3 Int
|
|
||||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
--
|
|
||||||
--data TLSUpdate
|
|
||||||
-- = DestroyTLS
|
|
||||||
-- | TimerTLS
|
|
||||||
-- | IntensityTLS TLSIntensity
|
|
||||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
|
|
||||||
data LSParam = LSParam -- LSPosRadCol
|
data LSParam = LSParam -- LSPosRadCol
|
||||||
{ _lsPos :: !Point3
|
{ _lsPos :: !Point3
|
||||||
, _lsRad :: !Float
|
, _lsRad :: !Float
|
||||||
@@ -34,24 +23,13 @@ data LSParam = LSParam -- LSPosRadCol
|
|||||||
data LightSource = LS
|
data LightSource = LS
|
||||||
{ _lsID :: Int
|
{ _lsID :: Int
|
||||||
, _lsParam :: LSParam
|
, _lsParam :: LSParam
|
||||||
, _lsDir :: Float
|
-- , _lsDir :: Float
|
||||||
, _lsPict :: LightSourceDraw --LightSource -> Picture
|
-- , _lsPict :: LightSourceDraw --LightSource -> Picture
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
--data TempLightSource = TLS
|
|
||||||
-- { _tlsParam :: LSParam
|
|
||||||
-- , _tlsUpdate :: TLSUpdate --TempLightSource -> Maybe TempLightSource
|
|
||||||
-- , _tlsTime :: Int
|
|
||||||
-- }
|
|
||||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
|
|
||||||
makeLenses ''LSParam
|
makeLenses ''LSParam
|
||||||
makeLenses ''LightSource
|
makeLenses ''LightSource
|
||||||
--makeLenses ''TempLightSource
|
|
||||||
deriveJSON defaultOptions ''LightSourceDraw
|
deriveJSON defaultOptions ''LightSourceDraw
|
||||||
--deriveJSON defaultOptions ''TLSIntensity
|
|
||||||
--deriveJSON defaultOptions ''TLSUpdate
|
|
||||||
deriveJSON defaultOptions ''LSParam
|
deriveJSON defaultOptions ''LSParam
|
||||||
deriveJSON defaultOptions ''LightSource
|
deriveJSON defaultOptions ''LightSource
|
||||||
--deriveJSON defaultOptions ''TempLightSource
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
module Dodge.Default.LightSource where
|
module Dodge.Default.LightSource
|
||||||
|
( defaultLS
|
||||||
|
) where
|
||||||
|
|
||||||
import Dodge.Data.LightSource
|
import Dodge.Data.LightSource
|
||||||
import Geometry
|
import Geometry
|
||||||
@@ -13,19 +15,4 @@ defaultLS =
|
|||||||
, _lsRad = 200
|
, _lsRad = 200
|
||||||
, _lsCol = 0.6
|
, _lsCol = 0.6
|
||||||
}
|
}
|
||||||
, _lsDir = 0
|
|
||||||
, _lsPict = DefaultLightSourceDraw --defLSPic
|
|
||||||
}
|
}
|
||||||
|
|
||||||
--defaultTLS :: TempLightSource
|
|
||||||
--defaultTLS =
|
|
||||||
-- TLS
|
|
||||||
-- { _tlsParam =
|
|
||||||
-- LSParam
|
|
||||||
-- { _lsPos = 0
|
|
||||||
-- , _lsRad = 0
|
|
||||||
-- , _lsCol = 0.5
|
|
||||||
-- }
|
|
||||||
-- , _tlsUpdate = TimerTLS
|
|
||||||
-- , _tlsTime = 1
|
|
||||||
-- }
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ module Dodge.EnergyBall
|
|||||||
|
|
||||||
import Dodge.DamageCircle
|
import Dodge.DamageCircle
|
||||||
import Dodge.Data.World
|
import Dodge.Data.World
|
||||||
import Dodge.LightSource
|
|
||||||
import Geometry
|
import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import Picture
|
import Picture
|
||||||
@@ -96,5 +95,4 @@ ebFlicker pt
|
|||||||
| _ebTimer pt `mod` 7 == 0 =
|
| _ebTimer pt `mod` 7 == 0 =
|
||||||
cWorld . lWorld . lights
|
cWorld . lWorld . lights
|
||||||
.:~ LSParam (addZ 20 $ _ebPos pt) 70 (0.5 *.*.* xyzV4 (_ebColor pt))
|
.:~ LSParam (addZ 20 $ _ebPos pt) 70 (0.5 *.*.* xyzV4 (_ebColor pt))
|
||||||
-- .:~ tlsTimeRadColPos 1 70 (0.5 *.*.* xyzV4 (_ebColor pt)) (addZ 20 $ _ebPos pt)
|
|
||||||
| otherwise = id
|
| otherwise = id
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import Dodge.Item.HeldOffset
|
|||||||
import Dodge.Item.Location
|
import Dodge.Item.Location
|
||||||
import Dodge.Item.Weapon.ExtraEffect
|
import Dodge.Item.Weapon.ExtraEffect
|
||||||
import Dodge.Item.Weapon.Radar
|
import Dodge.Item.Weapon.Radar
|
||||||
import Dodge.LightSource
|
|
||||||
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
||||||
import Dodge.Wall.Create
|
import Dodge.Wall.Create
|
||||||
import Dodge.Wall.Delete
|
import Dodge.Wall.Delete
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ module Dodge.Flame (
|
|||||||
import Dodge.Data.World
|
import Dodge.Data.World
|
||||||
import Data.Foldable
|
import Data.Foldable
|
||||||
import Data.Tuple
|
import Data.Tuple
|
||||||
import Dodge.LightSource
|
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import Dodge.WorldEvent.Cloud
|
import Dodge.WorldEvent.Cloud
|
||||||
import Dodge.WorldEvent.ThingsHit
|
import Dodge.WorldEvent.ThingsHit
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import Dodge.Inventory.Lock
|
|||||||
import Dodge.Item.Weapon.Radar
|
import Dodge.Item.Weapon.Radar
|
||||||
import Dodge.Item.Weapon.Shatter
|
import Dodge.Item.Weapon.Shatter
|
||||||
import Dodge.Item.Weapon.TriggerType
|
import Dodge.Item.Weapon.TriggerType
|
||||||
import Dodge.LightSource
|
|
||||||
import Dodge.Projectile.Create
|
import Dodge.Projectile.Create
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import Dodge.Tesla.Arc
|
import Dodge.Tesla.Arc
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ import Dodge.Data.LightSource
|
|||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Picture
|
import Picture
|
||||||
|
|
||||||
drawLightSource :: LightSourceDraw -> LightSource -> Picture
|
drawLightSource :: LightSource -> Picture
|
||||||
drawLightSource lsd = case lsd of
|
drawLightSource = defLSPic
|
||||||
DefaultLightSourceDraw -> defLSPic
|
|
||||||
|
|
||||||
defLSPic :: LightSource -> Picture
|
defLSPic :: LightSource -> Picture
|
||||||
defLSPic ls = setLayer BloomNoZWrite . translate3 (_lsPos $ _lsParam ls) . color col $ circleSolid 4
|
defLSPic ls = setLayer BloomNoZWrite . translate3 (_lsPos $ _lsParam ls) . color col $ circleSolid 4
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
module Dodge.LightSource.Update where
|
|
||||||
|
|
||||||
import Control.Lens
|
|
||||||
import Dodge.Data.LightSource
|
|
||||||
import Geometry
|
|
||||||
|
|
||||||
--updateTempLightSource :: TLSUpdate -> TempLightSource -> Maybe TempLightSource
|
|
||||||
--updateTempLightSource tlsu = case tlsu of
|
|
||||||
-- DestroyTLS -> const Nothing
|
|
||||||
-- TimerTLS -> timerTLS
|
|
||||||
-- IntensityTLS ConstantIntensity -> updateTempLightSource TimerTLS
|
|
||||||
-- IntensityTLS (TLSFade startcol x) -> fadeTLS startcol x
|
|
||||||
--
|
|
||||||
--fadeTLS :: Point3 -> Int -> TempLightSource -> Maybe TempLightSource
|
|
||||||
--fadeTLS startcol x tls
|
|
||||||
-- | t < 1 = Nothing
|
|
||||||
-- | t < x = Just $ tls & tlsParam . lsCol .~ (1 / fromIntegral (x - t)) *.*.* startcol
|
|
||||||
-- | otherwise = Just $ tls & tlsParam . lsCol .~ startcol -- this is wasteful, should be set once at begining
|
|
||||||
-- where
|
|
||||||
-- t = _tlsTime tls
|
|
||||||
--
|
|
||||||
--timerTLS :: TempLightSource -> Maybe TempLightSource
|
|
||||||
--timerTLS t
|
|
||||||
-- | _tlsTime t <= 0 = Nothing
|
|
||||||
-- | otherwise = Just $ t & tlsTime -~ 1
|
|
||||||
@@ -217,6 +217,5 @@ placeMachineWalls wl col poly mcid wlid = flip (foldr f) $ zip [wlid ..] $ loopP
|
|||||||
mvLS :: Point3 -> Float -> LightSource -> LightSource
|
mvLS :: Point3 -> Float -> LightSource -> LightSource
|
||||||
mvLS (V3 x y z) rot ls =
|
mvLS (V3 x y z) rot ls =
|
||||||
ls & lsParam . lsPos .~ V3 x y z +.+.+ startPos
|
ls & lsParam . lsPos .~ V3 x y z +.+.+ startPos
|
||||||
& lsDir .~ rot
|
|
||||||
where
|
where
|
||||||
startPos = onXY (rotateV rot) $ _lsPos (_lsParam ls)
|
startPos = onXY (rotateV rot) $ _lsPos (_lsParam ls)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ extraPics cfig u =
|
|||||||
<> foldMap drawBul (_bullets lw)
|
<> foldMap drawBul (_bullets lw)
|
||||||
<> foldMap drawBlip (_radarBlips lw)
|
<> foldMap drawBlip (_radarBlips lw)
|
||||||
<> _flares lw
|
<> _flares lw
|
||||||
<> foldMap (dbArg (drawLightSource . _lsPict)) (_lightSources lw)
|
<> foldMap drawLightSource (_lightSources lw)
|
||||||
<> foldMap ppDraw (_pressPlates lw)
|
<> foldMap ppDraw (_pressPlates lw)
|
||||||
<> viewClipBounds cfig w
|
<> viewClipBounds cfig w
|
||||||
<> debugDraw cfig w
|
<> debugDraw cfig w
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import Dodge.Flame
|
|||||||
import Dodge.Inventory
|
import Dodge.Inventory
|
||||||
import Dodge.Item.Location
|
import Dodge.Item.Location
|
||||||
import Dodge.Laser.Update
|
import Dodge.Laser.Update
|
||||||
import Dodge.LightSource.Update
|
|
||||||
import Dodge.LinearShockwave.Update
|
import Dodge.LinearShockwave.Update
|
||||||
import Dodge.ListDisplayParams
|
import Dodge.ListDisplayParams
|
||||||
import Dodge.Machine.Update
|
import Dodge.Machine.Update
|
||||||
@@ -276,7 +275,6 @@ functionalUpdate u =
|
|||||||
. over uvWorld (updateIMl' (_linearShockwaves . _lWorld . _cWorld) updateLinearShockwave)
|
. over uvWorld (updateIMl' (_linearShockwaves . _lWorld . _cWorld) updateLinearShockwave)
|
||||||
. over uvWorld (updateIMl' (_props . _lWorld . _cWorld) updateProp)
|
. over uvWorld (updateIMl' (_props . _lWorld . _cWorld) updateProp)
|
||||||
. over uvWorld (updateIMl' (_projectiles . _lWorld . _cWorld) updateProjectile)
|
. over uvWorld (updateIMl' (_projectiles . _lWorld . _cWorld) updateProjectile)
|
||||||
-- . over uvWorld updateLightSources
|
|
||||||
. over uvWorld updateClouds
|
. over uvWorld updateClouds
|
||||||
. over uvWorld updateGusts
|
. over uvWorld updateGusts
|
||||||
. over uvWorld (updateMIM (cWorld . lWorld . magnets) (doMagnetUpdate . _mgUpdate))
|
. over uvWorld (updateMIM (cWorld . lWorld . magnets) (doMagnetUpdate . _mgUpdate))
|
||||||
@@ -531,9 +529,6 @@ updateObjCatMaybes p f w = w' & cWorld . lWorld . p #~ catMaybes newxs
|
|||||||
updateDistortions :: World -> World
|
updateDistortions :: World -> World
|
||||||
updateDistortions = updateObjMapMaybe distortions updateDistortion
|
updateDistortions = updateObjMapMaybe distortions updateDistortion
|
||||||
|
|
||||||
--updateLightSources :: World -> World
|
|
||||||
--updateLightSources = updateObjMapMaybe tempLightSources (\b -> updateTempLightSource (_tlsUpdate b) b)
|
|
||||||
|
|
||||||
updateRadarBlips :: World -> World
|
updateRadarBlips :: World -> World
|
||||||
updateRadarBlips = updateObjMapMaybe radarBlips updateRadarBlip
|
updateRadarBlips = updateObjMapMaybe radarBlips updateRadarBlip
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import Dodge.Base.Collide
|
|||||||
import Dodge.Data.World
|
import Dodge.Data.World
|
||||||
import Dodge.EnergyBall
|
import Dodge.EnergyBall
|
||||||
import Dodge.Flame
|
import Dodge.Flame
|
||||||
import Dodge.LightSource
|
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import Dodge.WorldEvent.Shockwave
|
import Dodge.WorldEvent.Shockwave
|
||||||
import Dodge.WorldEvent.SpawnParticle
|
import Dodge.WorldEvent.SpawnParticle
|
||||||
|
|||||||
Reference in New Issue
Block a user