summary refs log tree commit diff
path: root/src/World/Generation/ChunkNeighbors.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-29 03:31:42 +0200
committerMel <einebeere@gmail.com>2023-07-29 03:31:42 +0200
commit6b69d4b5b648253f894707723af0e2eae9f71445 (patch)
tree0cd0b6c7b18c30abbb2618f553f144d1d06dacba /src/World/Generation/ChunkNeighbors.hpp
parent2eef7cf49b7a15559ee7bb6719411bcf67386213 (diff)
downloadmeowcraft-6b69d4b5b648253f894707723af0e2eae9f71445.tar.zst
meowcraft-6b69d4b5b648253f894707723af0e2eae9f71445.zip
Move chunk reification to worker threads and set stage for chunk-unbound lighting
Diffstat (limited to 'src/World/Generation/ChunkNeighbors.hpp')
-rw-r--r--src/World/Generation/ChunkNeighbors.hpp13
1 files changed, 11 insertions, 2 deletions
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
+}