diff options
| author | Mel <einebeere@gmail.com> | 2023-07-29 03:31:42 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-29 03:31:42 +0200 |
| commit | 6b69d4b5b648253f894707723af0e2eae9f71445 (patch) | |
| tree | 0cd0b6c7b18c30abbb2618f553f144d1d06dacba /src/World/Chunk.hpp | |
| parent | 2eef7cf49b7a15559ee7bb6719411bcf67386213 (diff) | |
| download | meowcraft-6b69d4b5b648253f894707723af0e2eae9f71445.tar.zst meowcraft-6b69d4b5b648253f894707723af0e2eae9f71445.zip | |
Move chunk reification to worker threads and set stage for chunk-unbound lighting
Diffstat (limited to 'src/World/Chunk.hpp')
| -rw-r--r-- | src/World/Chunk.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<BlockData> m_blocks; + Bool m_damaged = false; + Details m_details; }; |
