Add tilemap floors to rooms

This commit is contained in:
jgk
2021-06-15 14:56:32 +02:00
parent 73bd407c49
commit da631e3b37
31 changed files with 181 additions and 66 deletions
+4 -5
View File
@@ -37,7 +37,7 @@ addTextureArray texturePath shad = do
let tex = convertRGBA8 cmap
textureOb <- genObjectName
textureBinding Texture2DArray $= Just textureOb
let texData = tilesToLine 128 32 8 .
let texData = tilesToLine 128 8 .
V.toList $ imageData tex
--wtex = fromIntegral $ imageWidth tex
--htex = fromIntegral $ imageHeight tex
@@ -50,12 +50,11 @@ addTextureArray texturePath shad = do
-- I am completely unclear on why this works with its current parameters
tilesToLine
:: Int -- ^ Tile width
-> Int -- ^ Tile height
-> Int -- ^ Number of tiles per line
:: Int -- ^ Parameter a
-> Int -- ^ Parameter b
-> [a]
-> [a]
tilesToLine w h n = concat . concat . transpose . chunksOf n . chunksOf w
tilesToLine w n = concat . concat . transpose . chunksOf n . chunksOf w
addUniforms :: [String] -> FullShader -> IO (FullShader)
addUniforms uniStrings shad = do