Move towards uploading certain vbos less than once per frame (floor)

This commit is contained in:
2023-03-17 17:47:12 +00:00
parent 850fdf1783
commit d8fb7a1f99
7 changed files with 29 additions and 8 deletions
+10 -4
View File
@@ -3,6 +3,9 @@ module Dodge.StartNewGame (
startSeedGame,
) where
import Data.Preload.Render
import Shader.Data
import Shader.Poke -- it would be very nice to remove/rework the poking dependencies
import Dodge.Menu.Loading
import Dodge.Concurrent
--import Dodge.Menu.Option
@@ -23,11 +26,14 @@ blockingLoad str f u = u & uvScreenLayers .:~ loadingScreen str
& addSideEffect f str
startSeedGame :: Int -> Int -> Universe -> Universe
startSeedGame _ i = blockingLoad "LOADING" (startSeedGameConc i)
startSeedGame _ i u = blockingLoad "LOADING" (startSeedGameConc i $ u ^. preloadData) u
startSeedGameConc :: Int -> IO (Universe -> Maybe Universe)
startSeedGameConc seed = do
w <- generateWorldFromSeed seed
startSeedGameConc :: Int -> PreloadData -> IO (Universe -> Maybe Universe)
startSeedGameConc seed pdata = do
w' <- generateWorldFromSeed seed
nfloorvxs <- pokeFloors (pdata ^?! renderData . textureArrayShader . _2 . vboPtr)
(w' ^. cWorld . floorTiles)
let w = w' & numberFloorVerxs .~ nfloorvxs
writeFile "saveSlot/seed" $ show seed
return $ Just
. saveWorldInSlot (LevelStartSlot 0)