Add num_shadow_casters graphics parameter, allow cycle down enum options
This commit is contained in:
@@ -2,6 +2,7 @@ module Dodge.Render.Lights (
|
||||
lightsToRender,
|
||||
) where
|
||||
|
||||
import Data.List (sortOn)
|
||||
import Data.Maybe
|
||||
import Dodge.Data.LWorld
|
||||
import Dodge.Data.CamPos
|
||||
@@ -11,7 +12,9 @@ import qualified IntMapHelp as IM
|
||||
import Control.Lens
|
||||
|
||||
lightsToRender :: Configuration -> CamPos -> LWorld -> [(Point3, Float, Point3)]
|
||||
lightsToRender cfig campos w =
|
||||
{-# INLINE lightsToRender #-}
|
||||
lightsToRender cfig campos w = take (fromEnum $ cfig ^. graphics_num_shadow_casters) $
|
||||
sortOn (\(_,x,_) -> negate x) $
|
||||
mapMaybe getLS (IM.elems $ w ^. lightSources)
|
||||
++ mapMaybe getTLS (w ^. tempLightSources)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user