diff --git a/src/Dodge/Creature/State.hs b/src/Dodge/Creature/State.hs index 2b553d8c9..0546c5abf 100644 --- a/src/Dodge/Creature/State.hs +++ b/src/Dodge/Creature/State.hs @@ -25,7 +25,6 @@ import Dodge.Hammer import Dodge.ItEffect import Dodge.Item.Grammar import Dodge.Item.HeldOffset -import Dodge.LightSource import Dodge.Prop.Gib import Dodge.SoundLogic import Dodge.Zoning.Creature diff --git a/src/Dodge/Data/LightSource.hs b/src/Dodge/Data/LightSource.hs index 97610f153..be6c2a80c 100644 --- a/src/Dodge/Data/LightSource.hs +++ b/src/Dodge/Data/LightSource.hs @@ -13,17 +13,6 @@ import Geometry data LightSourceDraw = DefaultLightSourceDraw 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 { _lsPos :: !Point3 , _lsRad :: !Float @@ -34,24 +23,13 @@ data LSParam = LSParam -- LSPosRadCol data LightSource = LS { _lsID :: Int , _lsParam :: LSParam - , _lsDir :: Float - , _lsPict :: LightSourceDraw --LightSource -> Picture +-- , _lsDir :: Float +-- , _lsPict :: LightSourceDraw --LightSource -> Picture } 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 ''LightSource ---makeLenses ''TempLightSource deriveJSON defaultOptions ''LightSourceDraw ---deriveJSON defaultOptions ''TLSIntensity ---deriveJSON defaultOptions ''TLSUpdate deriveJSON defaultOptions ''LSParam deriveJSON defaultOptions ''LightSource ---deriveJSON defaultOptions ''TempLightSource diff --git a/src/Dodge/Default/LightSource.hs b/src/Dodge/Default/LightSource.hs index 70e178fde..983813efe 100644 --- a/src/Dodge/Default/LightSource.hs +++ b/src/Dodge/Default/LightSource.hs @@ -1,4 +1,6 @@ -module Dodge.Default.LightSource where +module Dodge.Default.LightSource + ( defaultLS + ) where import Dodge.Data.LightSource import Geometry @@ -13,19 +15,4 @@ defaultLS = , _lsRad = 200 , _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 --- } diff --git a/src/Dodge/EnergyBall.hs b/src/Dodge/EnergyBall.hs index 84c8bc6a5..1966011b8 100644 --- a/src/Dodge/EnergyBall.hs +++ b/src/Dodge/EnergyBall.hs @@ -7,7 +7,6 @@ module Dodge.EnergyBall import Dodge.DamageCircle import Dodge.Data.World -import Dodge.LightSource import Geometry import LensHelp import Picture @@ -96,5 +95,4 @@ ebFlicker pt | _ebTimer pt `mod` 7 == 0 = cWorld . lWorld . lights .:~ 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 diff --git a/src/Dodge/Euse.hs b/src/Dodge/Euse.hs index 8763cb51e..6a2f62718 100644 --- a/src/Dodge/Euse.hs +++ b/src/Dodge/Euse.hs @@ -11,7 +11,6 @@ import Dodge.Item.HeldOffset import Dodge.Item.Location import Dodge.Item.Weapon.ExtraEffect import Dodge.Item.Weapon.Radar -import Dodge.LightSource import Dodge.SoundLogic.ExternallyGeneratedSounds import Dodge.Wall.Create import Dodge.Wall.Delete diff --git a/src/Dodge/Flame.hs b/src/Dodge/Flame.hs index 9317d593f..e0c7b6447 100644 --- a/src/Dodge/Flame.hs +++ b/src/Dodge/Flame.hs @@ -7,7 +7,6 @@ module Dodge.Flame ( import Dodge.Data.World import Data.Foldable import Data.Tuple -import Dodge.LightSource import Dodge.SoundLogic import Dodge.WorldEvent.Cloud import Dodge.WorldEvent.ThingsHit diff --git a/src/Dodge/HeldUse.hs b/src/Dodge/HeldUse.hs index 902bf3533..db6ea5f24 100644 --- a/src/Dodge/HeldUse.hs +++ b/src/Dodge/HeldUse.hs @@ -21,7 +21,6 @@ import Dodge.Inventory.Lock import Dodge.Item.Weapon.Radar import Dodge.Item.Weapon.Shatter import Dodge.Item.Weapon.TriggerType -import Dodge.LightSource import Dodge.Projectile.Create import Dodge.SoundLogic import Dodge.Tesla.Arc diff --git a/src/Dodge/LightSource/Draw.hs b/src/Dodge/LightSource/Draw.hs index 5d0253118..1fe03597d 100644 --- a/src/Dodge/LightSource/Draw.hs +++ b/src/Dodge/LightSource/Draw.hs @@ -4,9 +4,8 @@ import Dodge.Data.LightSource import Geometry.Data import Picture -drawLightSource :: LightSourceDraw -> LightSource -> Picture -drawLightSource lsd = case lsd of - DefaultLightSourceDraw -> defLSPic +drawLightSource :: LightSource -> Picture +drawLightSource = defLSPic defLSPic :: LightSource -> Picture defLSPic ls = setLayer BloomNoZWrite . translate3 (_lsPos $ _lsParam ls) . color col $ circleSolid 4 diff --git a/src/Dodge/LightSource/Update.hs b/src/Dodge/LightSource/Update.hs deleted file mode 100644 index 31bf21b35..000000000 --- a/src/Dodge/LightSource/Update.hs +++ /dev/null @@ -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 diff --git a/src/Dodge/Placement/PlaceSpot.hs b/src/Dodge/Placement/PlaceSpot.hs index af5552a32..a5b29e71b 100644 --- a/src/Dodge/Placement/PlaceSpot.hs +++ b/src/Dodge/Placement/PlaceSpot.hs @@ -217,6 +217,5 @@ placeMachineWalls wl col poly mcid wlid = flip (foldr f) $ zip [wlid ..] $ loopP mvLS :: Point3 -> Float -> LightSource -> LightSource mvLS (V3 x y z) rot ls = ls & lsParam . lsPos .~ V3 x y z +.+.+ startPos - & lsDir .~ rot where startPos = onXY (rotateV rot) $ _lsPos (_lsParam ls) diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index 1d9d2162b..3d036bf2c 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -95,7 +95,7 @@ extraPics cfig u = <> foldMap drawBul (_bullets lw) <> foldMap drawBlip (_radarBlips lw) <> _flares lw - <> foldMap (dbArg (drawLightSource . _lsPict)) (_lightSources lw) + <> foldMap drawLightSource (_lightSources lw) <> foldMap ppDraw (_pressPlates lw) <> viewClipBounds cfig w <> debugDraw cfig w diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index 022b26d53..dca6ea631 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -27,7 +27,6 @@ import Dodge.Flame import Dodge.Inventory import Dodge.Item.Location import Dodge.Laser.Update -import Dodge.LightSource.Update import Dodge.LinearShockwave.Update import Dodge.ListDisplayParams import Dodge.Machine.Update @@ -276,7 +275,6 @@ functionalUpdate u = . over uvWorld (updateIMl' (_linearShockwaves . _lWorld . _cWorld) updateLinearShockwave) . over uvWorld (updateIMl' (_props . _lWorld . _cWorld) updateProp) . over uvWorld (updateIMl' (_projectiles . _lWorld . _cWorld) updateProjectile) --- . over uvWorld updateLightSources . over uvWorld updateClouds . over uvWorld updateGusts . 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 = updateObjMapMaybe distortions updateDistortion ---updateLightSources :: World -> World ---updateLightSources = updateObjMapMaybe tempLightSources (\b -> updateTempLightSource (_tlsUpdate b) b) - updateRadarBlips :: World -> World updateRadarBlips = updateObjMapMaybe radarBlips updateRadarBlip diff --git a/src/Dodge/WorldEvent/Explosion.hs b/src/Dodge/WorldEvent/Explosion.hs index ff01c8d99..51e083950 100644 --- a/src/Dodge/WorldEvent/Explosion.hs +++ b/src/Dodge/WorldEvent/Explosion.hs @@ -14,7 +14,6 @@ import Dodge.Base.Collide import Dodge.Data.World import Dodge.EnergyBall import Dodge.Flame -import Dodge.LightSource import Dodge.SoundLogic import Dodge.WorldEvent.Shockwave import Dodge.WorldEvent.SpawnParticle