Refactor light sources
This commit is contained in:
@@ -19,12 +19,12 @@ flickerMod pl = Just $ sps0 $ PutMod $ ModIDTimerPoint3Bool
|
||||
flickerUpdate :: Modification -> World -> World
|
||||
flickerUpdate md w
|
||||
| _mdTimer md > 0 = w & modifications . ix mdid . mdTimer -~ 1
|
||||
| otherwise = w & lightSources . ix lsid . lsIntensity .~ mdcol
|
||||
| otherwise = w & lightSources . ix lsid . lsParam . lsCol .~ mdcol
|
||||
& modifications . ix mdid
|
||||
%~ ( (mdTimer .~ newtime) . (mdPoint3 .~ lscol) . (mdBool %~ not) )
|
||||
where
|
||||
mdcol = _mdPoint3 md
|
||||
lscol = _lsIntensity $ _lightSources w IM.! lsid
|
||||
lscol = _lsCol $ _lsParam $ _lightSources w IM.! lsid
|
||||
lsid = _mdExternalID md
|
||||
mdid = _mdID md
|
||||
timerange
|
||||
|
||||
Reference in New Issue
Block a user