Add test tileset textures

This commit is contained in:
2021-06-11 13:51:06 +02:00
parent 02511afa80
commit a9aa2ca2cb
18 changed files with 75 additions and 38 deletions
+32 -3
View File
@@ -31,7 +31,7 @@ setWallDepth
-> (Float,Float) -- ^ View from point
-> GLmatrix GLfloat
-> IO Word32
setWallDepth pdata wallPoints (viewFromx,viewFromy) pmat = do
setWallDepth pdata wallPoints (viewFromx,viewFromy) _ = do
startTicks <- SDL.ticks
colorMask $= Color4 Disabled Disabled Disabled Disabled
nWalls <- F.foldM (pokeShader $ _lightingOccludeShader pdata) wallPoints
@@ -41,6 +41,8 @@ setWallDepth pdata wallPoints (viewFromx,viewFromy) pmat = do
-- reseting this uniform appears to be necessary
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
$= Vector2 viewFromx viewFromy
-- the following uniform, however, was probably already set by
-- createLightMap
-- uniform ( (_shaderMatrixUniform $ _lightingOccludeShader pdata))
-- $= pmat
-- cullFace $= Just Front
@@ -92,8 +94,7 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) pmat _
currentProgram $= Just (_shaderProgram $ _lightingOccludeShader pdata)
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
$= Vector2 viewFromx viewFromy
uniform ( (_shaderMatrixUniform $ _lightingOccludeShader pdata))
$= pmat
uniform (_shaderMatrixUniform $ _lightingOccludeShader pdata) $= pmat
cullFace $= Just Back
drawShader (_lightingOccludeShader pdata) nWalls
@@ -225,6 +226,34 @@ setCommonUniforms pdata rot camZoom (tranx,trany) (winx,winy) = do
: map extractProgAndUnis (_pictureShaders pdata)
)
setIsoMatrixUniforms
:: RenderData
-> Float -- ^ Rotation
-> Float -- ^ Zoom
-> (Float,Float) -- ^ Translation
-> (Float,Float) -- ^ Window size
-> IO ()
setIsoMatrixUniforms pdata rot camZoom (tranx,trany) (winx,winy) = do
setShaderUniforms rot camZoom (tranx,trany) (winx,winy)
( extractProgAndUnis (_lightingFloorShader pdata)
: extractProgAndUnis (_backgroundShader pdata)
: extractProgAndUnis (_textureShader pdata)
: map extractProgAndUnis (_pictureShaders pdata)
)
renderShader
:: Foldable f
=> FullShader a
-> f a
-> IO Word32
renderShader shad dat = do
sticks <- SDL.ticks
i <- F.foldM (pokeShader shad) dat
bindShaderBuffers [shad] [i]
drawShader shad i
eticks <- SDL.ticks
return $ eticks - sticks
renderFoldable
:: Foldable f
=> RenderData