Allow for no-ammo muzzles
This commit is contained in:
+8
-13
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user