Refactor light sources

This commit is contained in:
2021-11-28 16:53:26 +00:00
parent 1d9dd3e4e0
commit 618653a86e
28 changed files with 169 additions and 155 deletions
+14 -12
View File
@@ -57,6 +57,7 @@ data Universe = Universe
, _preloadData :: PreloadData
, _menuLayers :: [ScreenLayer]
, _savedWorlds :: M.Map SaveSlot World
, _keyConfig :: KeyConfigSDL
}
data World = World
{ _keys :: !(S.Set Scancode)
@@ -115,7 +116,6 @@ data World = World
, _distortions :: [Distortion]
, _worldBounds :: Bounds
, _gameRooms :: [GameRoom] -- consider using and IntMap
, _keyConfig :: KeyConfigSDL
, _config :: Configuration
, _rewindWorlds :: [World]
, _rewinding :: Bool
@@ -192,20 +192,21 @@ data Cloud = Cloud
data CloudType
= SmokeCloud
| GasCloud
data LightSource = LS
{ _lsID :: !Int
, _lsPos :: !Point3
, _lsDir :: !Float
data LSParam = LSParam
{ _lsPos :: !Point3
, _lsRad :: !Float
, _lsIntensity :: !Point3
, _lsPict :: LightSource -> Picture
, _lsCol :: !Point3
}
data LightSource = LS
{ _lsID :: !Int
, _lsParam :: LSParam
, _lsDir :: !Float
, _lsPict :: LightSource -> Picture
}
data TempLightSource = TLS
{ _tlsPos :: !Point3
, _tlsRad :: !Float
, _tlsIntensity :: !Point3
, _tlsUpdate :: World -> TempLightSource -> Maybe TempLightSource
, _tlsTime :: !Int
{ _tlsParam :: LSParam
, _tlsUpdate :: World -> TempLightSource -> Maybe TempLightSource
, _tlsTime :: !Int
}
data Creature = Creature
{ _crPos :: Point2
@@ -904,3 +905,4 @@ makeLenses ''Vocalization
makeLenses ''UseDelay
makeLenses ''AimParams
makeLenses ''Universe
makeLenses ''LSParam