Remove RenderType datatype
This commit is contained in:
+21
-2
@@ -8,6 +8,7 @@ module Shader.Poke
|
||||
, pokePoint33s
|
||||
, pokeVerxs
|
||||
, pokeLayVerxs
|
||||
, pokeWalls
|
||||
) where
|
||||
import Shader.Data
|
||||
import Shader.Parameters
|
||||
@@ -55,7 +56,7 @@ pokeVerxs :: PicShads VBO -> [Verx] -> IO (PicShads Int)
|
||||
pokeVerxs vbos vxs0 = go vxs0 (pure 0)
|
||||
where
|
||||
go [] count = return count
|
||||
go (!vx:vxs) count = pokeVerx vbos count vx >> go vxs (addCountVerx count vx)
|
||||
go (!vx:vxs) !count = pokeVerx vbos count vx >> (go vxs $! addCountVerx count vx)
|
||||
|
||||
-- this is very brittle, but want to optimise speed if possible here
|
||||
pokeVerx :: PicShads VBO -> PicShads Int -> Verx -> IO ()
|
||||
@@ -175,7 +176,7 @@ pokeLayVerxs :: PicShads VBO -> [Verx] -> IO (IM.IntMap (PicShads Int))
|
||||
pokeLayVerxs vbos vxs0 = go vxs0 (IM.fromList $ (, pure 0) <$> [0..5])
|
||||
where
|
||||
go [] count = return count
|
||||
go (!vx:vxs) count = pokeLayVerx vbos count vx >> go vxs (addLayCountVerx count vx)
|
||||
go (!vx:vxs) !count = pokeLayVerx vbos count vx >> (go vxs $! addLayCountVerx count vx)
|
||||
|
||||
-- this is very brittle, but want to optimise speed if possible here
|
||||
pokeLayVerx :: PicShads VBO -> IM.IntMap (PicShads Int) -> Verx -> IO ()
|
||||
@@ -214,3 +215,21 @@ addLayCountVerx :: IM.IntMap (PicShads Int) -> Verx -> IM.IntMap (PicShads Int)
|
||||
addLayCountVerx m vx = IM.adjust f (_vxLayer vx) m
|
||||
where
|
||||
f = flip addCountVerx vx
|
||||
|
||||
pokeWalls :: Ptr Float -> [((Point2,Point2),Point4)] -> IO Int
|
||||
pokeWalls ptr vals0 = go vals0 0
|
||||
where
|
||||
go [] n = return n
|
||||
go ((((V2 a b),(V2 c d)),(V4 e f g h)):vals) !n = do
|
||||
pokeElemOff ptr (off 0) a
|
||||
pokeElemOff ptr (off 1) b
|
||||
pokeElemOff ptr (off 2) c
|
||||
pokeElemOff ptr (off 3) d
|
||||
pokeElemOff ptr (off 4) e
|
||||
pokeElemOff ptr (off 5) f
|
||||
pokeElemOff ptr (off 6) g
|
||||
pokeElemOff ptr (off 7) h
|
||||
go vals (n+1)
|
||||
where
|
||||
off i = n*8 + i
|
||||
|
||||
|
||||
Reference in New Issue
Block a user