diff --git a/src/Dodge/Render.hs b/src/Dodge/Render.hs index 12b7aaa72..e25ac9a57 100644 --- a/src/Dodge/Render.hs +++ b/src/Dodge/Render.hs @@ -77,12 +77,11 @@ doDrawing pdata w = do then renderTextureWalls pdata nWalls else renderBlankWalls pdata nWalls - let shads = _pictureShaders pdata shadV <- picShadToMV $ _pictureShaders pdata renderFoldable shadV $ polysToPic $ foregroundPics w layerCounts <- UMV.replicate (6*6) 0 - vnums <- pokeBindFoldableLayer shadV layerCounts $ worldPictures w + pokeBindFoldableLayer shadV layerCounts $ worldPictures w renderLayer' 0 shadV layerCounts nTextArrayVs <- pokePoint33s (shadVBOptr $ _textureArrayShader pdata) (_floorTiles w) diff --git a/src/Render.hs b/src/Render.hs index 4294fb3ce..db35ea80f 100644 --- a/src/Render.hs +++ b/src/Render.hs @@ -161,11 +161,10 @@ pokeBindFoldableLayer :: MV.MVector (PrimState IO) VShader -> UMV.MVector (PrimState IO) Int -> Picture - -> IO (IM.IntMap (PicShads Int)) + -> IO () pokeBindFoldableLayer shadV counts m = do - slist'' <- pokeLayVerxs shadV counts m + pokeLayVerxs shadV counts m bindShaderLayers shadV counts - return slist'' renderFoldable :: MV.MVector (PrimState IO) VShader diff --git a/src/Shader/Poke.hs b/src/Shader/Poke.hs index c9b2275c6..746ac5dc7 100644 --- a/src/Shader/Poke.hs +++ b/src/Shader/Poke.hs @@ -22,9 +22,9 @@ import Geometry.Data --import Data.Maybe --import Data.List import Foreign -import Control.Monad +--import Control.Monad --import qualified Control.Foldl as F -import qualified Data.IntMap.Strict as IM +--import qualified Data.IntMap.Strict as IM --import Control.Lens import qualified Data.Vector.Unboxed.Mutable as UMV import qualified Data.Vector.Mutable as MV @@ -124,12 +124,12 @@ pokePoint3s ptr vals0 = go vals0 0 where off i = n*3 + i -pokeLayVerxs :: MV.MVector (PrimState IO) VShader +pokeLayVerxs + :: MV.MVector (PrimState IO) VShader -> UMV.MVector (PrimState IO) Int - -> [Verx] -> IO (IM.IntMap (PicShads Int)) -pokeLayVerxs vbos counts vxs = do - VS.mapM_ (pokeLayVerx vbos counts) $ VS.fromList vxs - vToLayPicShad counts + -> [Verx] + -> IO () +pokeLayVerxs vbos counts vxs = VS.mapM_ (pokeLayVerx vbos counts) $ VS.fromList vxs pokeLayVerx :: MV.MVector (PrimState IO) VShader -> UMV.MVector (PrimState IO) Int -> Verx -> IO () --{-# INLINE pokeLayVerx #-} @@ -150,12 +150,6 @@ pokeLayVerx vbos counts vx = do layOff = theLayer * numSubElements theStride = pokeStride sn -vToLayPicShad :: UMV.MVector RealWorld Int -> IO (IM.IntMap (PicShads Int)) -{-# INLINE vToLayPicShad #-} -vToLayPicShad mv = foldM f IM.empty [0..5] - where - f m i = fmap (\ps -> IM.insert i ps m) (vToPicShad $ UMV.unsafeSlice (i * 6) 6 mv) - pokeStride :: Int -> Int {-# INLINE pokeStride #-} pokeStride 0 = 7