Implement multiple radial distortion rendering
This commit is contained in:
@@ -53,6 +53,7 @@ update' w = case _menuLayers w of
|
||||
w
|
||||
(_ : _) -> w
|
||||
[] -> checkEndGame
|
||||
. updateRadialDistortions
|
||||
. updateTriggers
|
||||
. ppEvents
|
||||
. updateCamera
|
||||
@@ -89,6 +90,17 @@ updateCreatureGroups :: World -> World
|
||||
updateCreatureGroups w = w & creatureGroups %~
|
||||
IM.mapMaybe (\cgp -> _crGroupUpdate cgp w cgp)
|
||||
|
||||
updateRadialDistortions :: World -> World
|
||||
updateRadialDistortions = radDistortion %~ mapMaybe decreaseBulge
|
||||
|
||||
decreaseBulge
|
||||
:: (Point2,Point2,Point2,Float)
|
||||
-> Maybe (Point2,Point2,Point2,Float)
|
||||
decreaseBulge (a,b,c,v)
|
||||
| v > 1 = Just (a,b,c,max 1 (v - 0.05) )
|
||||
| v < 1 = Just (a,b,c,min 1 (v + 0.05) )
|
||||
| otherwise = Nothing
|
||||
|
||||
updateTriggers :: World -> World
|
||||
updateTriggers w
|
||||
| ResetLevel 1 `S.member` _worldTriggers w = generateLevelFromRoomList levx $ initialWorld
|
||||
|
||||
Reference in New Issue
Block a user