mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 05:10:57 +00:00
implement infinite worlds with threaded chunk generation
This commit is contained in:
@ -87,8 +87,13 @@ class Game: GameDelegate {
|
||||
|
||||
// Regenerate current chunk
|
||||
if regenChunk {
|
||||
self.world.generate(chunkID: World.makeID(position: self.player.position))
|
||||
let chunkID = World.makeID(position: self.player.position)
|
||||
let chunk = self.world.generateSingleChunkUncommitted(chunkID: chunkID)
|
||||
self.world.addChunk(chunkID: chunkID, chunk: chunk)
|
||||
}
|
||||
|
||||
self.world.generateAdjacentChunksIfNeeded(position: self.player.position)
|
||||
self.world.update()
|
||||
}
|
||||
|
||||
func draw(_ renderer: Renderer, _ time: GameTime) {
|
||||
|
Reference in New Issue
Block a user