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/Chunk.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/World/Chunk.hpp') diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp index 32d3ab3..1aa2dd1 100644 --- a/src/World/Chunk.hpp +++ b/src/World/Chunk.hpp @@ -21,8 +21,8 @@ public: m_position{(Real)x * Width, 0.0f, (Real)y * Width} {} struct BlockData { - BlockData() : type(BlockType::Air) {} - BlockData(BlockType t) : type(t), light{} {} + BlockData() : type(BlockType::Air), light{200} {} + BlockData(BlockType t) : type(t), light{200} {} BlockType type; U8 light; @@ -52,6 +52,9 @@ public: ChunkIndex index() const; Vector<3> position() const; + Bool is_damaged() const; + void damage(); + static Bool is_valid_position(U32 x, U32 y, U32 z); private: static U64 pos(U32 x, U32 y, U32 z); @@ -60,6 +63,8 @@ private: Vector<3> m_position; std::vector m_blocks; + Bool m_damaged = false; + Details m_details; }; -- cgit 1.4.1