From 6b69d4b5b648253f894707723af0e2eae9f71445 Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 29 Jul 2023 03:31:42 +0200 Subject: Move chunk reification to worker threads and set stage for chunk-unbound lighting --- src/World/Generation/ChunkNeighbors.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/World/Generation/ChunkNeighbors.hpp') diff --git a/src/World/Generation/ChunkNeighbors.hpp b/src/World/Generation/ChunkNeighbors.hpp index 1207c60..83fca4c 100644 --- a/src/World/Generation/ChunkNeighbors.hpp +++ b/src/World/Generation/ChunkNeighbors.hpp @@ -1,13 +1,22 @@ #pragma once #include "../Chunk.hpp" +#include "../ChunkRegistry.hpp" namespace MC::World::Generation { struct ChunkNeighbors { Chunk *north, *east, *south, *west; Chunk *north_east, *south_east, *south_west, *north_west; + + Bool all_exist() const { return north && east && south && west && north_east && south_east && south_west && north_west; } }; -Chunk::BlockData get_block_wrapping(const Chunk& chunk, const ChunkNeighbors& neighbors, Vector<3, I32> pos); +ChunkNeighbors find_chunk_neighbors(ChunkIndex chunk, ChunkRegistry& chunks); + +struct GetBlockWrappingResult { + bool does_exist; + Chunk::BlockData block; +}; +GetBlockWrappingResult get_block_wrapping(const Chunk& chunk, const ChunkNeighbors& neighbors, Vector<3, I32> pos); -} \ No newline at end of file +} -- cgit 1.4.1