diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index 8f54db80a..977b06162 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -41,7 +41,6 @@ import qualified Data.Set as Set import Padding --import Data.Foldable --- TODO only filter out shapes outside the range of the furthest shown light source worldSPic :: Configuration -> World -> Stream (Of SPic) IO () worldSPic cfig w = (S.yield (mempty, extraPics cfig w) ) @@ -49,13 +48,14 @@ worldSPic cfig w <> (S.each $ fmap (shiftDraw _blPos _blDir _blDraw) (filtOn _blPos _blocks) ) <> (S.each $ fmap (shiftDraw _fsPos _fsDir (const _fsSPic)) (filtOn _fsPos _shapes) ) <> (S.each $ fmap (dbArg _cpPict) (filtOn _cpPos _corpses) ) - <> (S.each $ fmap (dbArg _crPict) (filtOn _crPos _creatures) ) + <> (S.map (dbArg _crPict) (filtOn' _crPos _creatures) ) <> (S.each $ fmap floorItemSPic (filtOn _flItPos _floorItems) ) <> (S.each $ fmap btSPic (filtOn _btPos _buttons) ) <> (S.each $ fmap mcSPic (filtOn _mcPos _machines) ) <> S.yield (anyTargeting cfig w ) where filtOn f g = IM.filter (pointIsClose . f) (g w) + filtOn' f g = S.filter (pointIsClose . f) $ S.each (g w) pointIsClose = cullPoint cfig w anyTargeting :: Configuration -> World -> SPic diff --git a/src/Shader/Parameters.hs b/src/Shader/Parameters.hs index 1c8cae878..c8247b73d 100644 --- a/src/Shader/Parameters.hs +++ b/src/Shader/Parameters.hs @@ -21,8 +21,8 @@ glushortSize = sizeOf (0 :: GLushort) numDrawableElements :: Int {-# INLINE numDrawableElements #-} -numDrawableElements = 60000 +numDrawableElements = 6 * numSubElements numSubElements :: Int {-# INLINE numSubElements #-} -numSubElements = 10000 +numSubElements = 100000