Refactor picture rendering code

This commit is contained in:
2021-03-10 22:45:43 +01:00
parent a2fa713bde
commit e2c35b21bc
4 changed files with 153 additions and 289 deletions
+3 -6
View File
@@ -12,15 +12,14 @@ import Codec.Picture
import qualified Data.Vector.Storable as V
import Control.Lens
import Control.Monad
--import Control.Monad
import Foreign
import Shader
data RenderData = RenderData
{ --_charMap :: Image PixelRGBA8
_textures :: [TextureObject]
{ _textures :: [TextureObject]
, _backShader :: (Program, [UniformLocation])
, _wallShadowShader :: (Program, [UniformLocation])
, _lightmapCircleShader :: (Program, [UniformLocation])
@@ -35,7 +34,6 @@ data RenderData = RenderData
makeLenses ''RenderData
pokeTriStrat (RenderPoly vs) = fmap (\((x,y,z),(r,g,b,a)) -> [[x,y,z],[r,g,b,a]]) vs
pokeTriStrat _ = []
@@ -103,8 +101,7 @@ preloadRender = do
fadevao <- setupVAO [(0,4)]
return $ RenderData
{ -- _charMap = convertRGBA8 cmap
_textures = [dirttex,dirttex]
{ _textures = [dirttex,dirttex]
, _listShaders = [bslist,lslist,cslist,aslist,eslist]
, _lightmapCircleShader = fcs
, _backShader = bgs