Use texture array for character rendering, condense rendering
This commit is contained in:
+11
-11
@@ -34,15 +34,15 @@ pokeVerxs ::
|
||||
pokeVerxs vbos count = VFSM.mapM_ (pokeVerx vbos count) . VFSM.fromList
|
||||
|
||||
pokeVerx :: MV.MVector (PrimState IO) (Shader, VBO) -> UMV.MVector (PrimState IO) Int -> Verx -> IO ()
|
||||
pokeVerx vbos offsets Verx{_vxPos = thePos, _vxCol = theCol, _vxExt = ext, _vxShadNum = theShadNum} = do
|
||||
pokeVerx vbos offsets Verx{_vxPos = thePos, _vxCol = theCol, _vxExt = ext, _vxShadNum = shadnum} = do
|
||||
typeOff <- UMV.unsafeRead offsets sn
|
||||
basePtr <- _vboPtr . snd <$> MV.unsafeRead vbos sn
|
||||
let thePtr = plusPtr basePtr (typeOff * pokeStride sn * floatSize)
|
||||
let thePtr = plusPtr basePtr (typeOff * pokeStride shadnum * floatSize)
|
||||
poke34 thePtr thePos theCol
|
||||
pokeArrayOff thePtr 7 ext
|
||||
UMV.unsafeModify offsets (+ 1) sn
|
||||
where
|
||||
sn = _unShadNum theShadNum
|
||||
sn = _unShadNum shadnum
|
||||
|
||||
pokeWallsWindows ::
|
||||
Ptr Float ->
|
||||
@@ -416,21 +416,21 @@ pokeLayVerx vbos counts vx = do
|
||||
pokeArrayOff thePtr 7 (_vxExt vx)
|
||||
UMV.unsafeModify counts (+ 1) vecPos
|
||||
where
|
||||
sn = _unShadNum (_vxShadNum vx)
|
||||
sn = _unShadNum shadnum
|
||||
shadnum = _vxShadNum vx
|
||||
vecPos = theLayer * numLayers + sn
|
||||
theLayer = layerNum $ _vxLayer vx
|
||||
thePos = _vxPos vx
|
||||
theCol = _vxCol vx
|
||||
layOff = theLayer * numSubElements
|
||||
theStride = pokeStride sn
|
||||
theStride = pokeStride shadnum
|
||||
|
||||
pokeStride :: Int -> Int
|
||||
pokeStride :: ShadNum -> Int
|
||||
{-# INLINE pokeStride #-}
|
||||
pokeStride 0 = 7
|
||||
pokeStride 1 = 9
|
||||
pokeStride 2 = 10
|
||||
pokeStride 3 = 7
|
||||
pokeStride _ = undefined
|
||||
pokeStride PolyShad = 7
|
||||
pokeStride TextShad = 11
|
||||
pokeStride ArcShad = 10
|
||||
pokeStride EllShad = 7
|
||||
|
||||
poke34 :: Ptr Float -> Point3 -> Point4 -> IO ()
|
||||
{-# INLINE poke34 #-}
|
||||
|
||||
Reference in New Issue
Block a user