This commit is contained in:
2025-07-30 09:20:41 +01:00
parent 210171fbc9
commit 18770480e7
13 changed files with 41 additions and 12 deletions
+1
View File
@@ -28,6 +28,7 @@ data CWorld = CWorld
, _pathGraph :: Gr Point2 PathEdge
, _numberFloorVerxs :: Int
, _chasms :: [[Point2]]
, _numberChasmVerxs :: Int
}
data CWGen = CWGen
+1
View File
@@ -92,6 +92,7 @@ defaultCWorld =
, _cwTiles = mempty
, _numberFloorVerxs = 0
, _chasms = mempty
, _numberChasmVerxs = 0
}
defaultLWorld :: LWorld
+8
View File
@@ -58,6 +58,7 @@ doDrawing' win pdata u = do
viewFroms@(V2 vfx vfy) = w ^. wCam . camViewFrom
shadV = _pictureShaders pdata
nFls = w ^. cWorld . numberFloorVerxs
nchs = w ^. cWorld . numberChasmVerxs
-- bind as much data into vbos as feasible at this point
-- count mutable vectors setup
pokeCounts <- UMV.replicate (numLayers * numShads) 0
@@ -181,6 +182,13 @@ doDrawing' win pdata u = do
(fromIntegral nIndices)
GL_UNSIGNED_SHORT
nullPtr
-- draw chasm shader blocking floor
glUseProgram (pdata ^. chasmShader . shaderUINT)
glBindVertexArray $ pdata ^. chasmShader . shaderVAO . vaoName
glDrawArrays
(_unPrimitiveMode $ pdata ^. chasmShader . shaderPrimitive)
0
(fromIntegral nchs)
--draw floor onto base buffer
glUseProgram (pdata ^. floorShader . shaderUINT)
glBindVertexArray $ pdata ^. floorShader . shaderVAO . vaoName
+3 -3
View File
@@ -31,15 +31,15 @@ worldSPic cfig u =
<> foldup floorItemSPic (filtOn _flItPos (_unNIntMap . _floorItems))
<> foldup btSPic (filtOn _btPos _buttons)
<> foldup (mcSPic (u ^. uvWorld . cWorld . lWorld)) (filtOn _mcPos _machines)
<> foldMap' drawChasm (u ^. uvWorld . cWorld . chasms)
-- <> foldMap' drawChasm (u ^. uvWorld . cWorld . chasms)
where
w = _uvWorld u
foldup = foldMap'
filtOn f g = IM.filter (pointIsClose . f) (g (_lWorld (_cWorld w)))
pointIsClose = cullPoint cfig w
drawChasm :: [Point2] -> SPic
drawChasm = noShape . color green . setDepth 2 . polygon
--drawChasm :: [Point2] -> SPic
--drawChasm = noShape . color green . setDepth 2 . polygon
drawPulseBall :: PulseBall -> SPic
drawPulseBall pb =
+6
View File
@@ -19,4 +19,10 @@ postWorldLoad rdata cw = do
0
(cw ^. cwTiles)
bufferPokedVBO (rdata ^. floorVBO) nfloorvxs
nchasmvxs <- foldM (pokeChasm (rdata ^. chasmVBO . vboPtr))
0
(cw ^. chasms)
bufferPokedVBO (rdata ^. chasmVBO) nchasmvxs
return $ cw & numberFloorVerxs .~ nfloorvxs
& numberChasmVerxs .~ nchasmvxs