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
+1
View File
@@ -48,6 +48,7 @@ data World = World
, _pnZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature
, _peZoning :: IntMap (IntMap (Set PathEdgeNodes))
, _gsZoning :: IntMap (IntMap IntSet)
, _numberFloorVerxs :: Int
}
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
+1
View File
@@ -48,6 +48,7 @@ defaultWorld =
, _pnZoning = mempty
, _peZoning = mempty
, _gsZoning = mempty --Zoning IM.empty clZoneSize (zonePos _guPos)
, _numberFloorVerxs = 0
}
defaultCWGen :: CWGen
+4 -4
View File
@@ -24,14 +24,14 @@ generateWorldFromSeed i = do
writeFile "log/aGeneratedRoomLayout" ""
generateGraphs
(roomList, bounds) <- layoutLevelFromSeed 0 i
return $!
postGenerationProcessing $!
postGenerationProcessing $!
_gwWorld (generateLevelFromRoomList roomList initialWorld{_randGen = mkStdGen i})
& cWorld . cwGen . cwgRoomClipping .~ bounds
& cWorld . cwGen . cwgSeed .~ i
postGenerationProcessing :: World -> World
postGenerationProcessing w = foldl' assignPushDoors w (w ^. cWorld . lWorld . doors)
postGenerationProcessing :: World -> IO World
postGenerationProcessing w =
return $ foldl' assignPushDoors w (w ^. cWorld . lWorld . doors)
generateGraphs :: IO ()
generateGraphs = TIO.writeFile "graph/itemCombinations.gv" combinationsDotGraph
+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)