Allow for no-ammo muzzles

This commit is contained in:
2025-08-10 08:09:03 +01:00
parent 9d973b2570
commit aa412f1911
9 changed files with 283 additions and 283 deletions
+8 -13
View File
@@ -1,4 +1,4 @@
module Dodge.WorldLoad where
module Dodge.WorldLoad (postUniverseLoadSideEffect) where
import Control.Lens
import Control.Monad
@@ -9,20 +9,15 @@ import Shader.Data
import Shader.Poke.Floor
postUniverseLoadSideEffect :: Universe -> Universe
postUniverseLoadSideEffect = uvIOEffects %~ (\f uv -> (uvWorld . cWorld) (postWorldLoad (uv ^. preloadData . renderData)) uv >>= f)
postUniverseLoadSideEffect = uvIOEffects %~
(\f uv -> (uvWorld . cWorld) (postWorldLoad (uv ^. preloadData . renderData)) uv >>= f)
postWorldLoad :: RenderData -> CWorld -> IO CWorld
postWorldLoad rdata cw = do
nfloorvxs <-
foldM
(pokeTile (rdata ^. floorVBO . vboPtr))
0
(cw ^. cwTiles)
nfloorvxs <- foldM (pokeTile (rdata ^. floorVBO . vboPtr)) 0 (cw ^. cwTiles)
bufferPokedVBO (rdata ^. floorVBO) nfloorvxs
nchasmvxs <- foldM (pokeChasm (rdata ^. chasmVBO . vboPtr))
0
(cw ^. chasms)
nchasmvxs <- foldM (pokeChasm (rdata ^. chasmVBO . vboPtr)) 0 (cw ^. chasms)
bufferPokedVBO (rdata ^. chasmVBO) nchasmvxs
return $ cw & numberFloorVerxs .~ nfloorvxs
& numberChasmVerxs .~ nchasmvxs
return $
cw & numberFloorVerxs .~ nfloorvxs
& numberChasmVerxs .~ nchasmvxs