summary refs log tree commit diff
path: root/src/World/Chunk.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-21 02:17:03 +0200
committerMel <einebeere@gmail.com>2023-07-21 02:17:03 +0200
commit23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a (patch)
treed2979c12a9675885b7ed969d5f51dbd69d969286 /src/World/Chunk.hpp
parentc0556f76fc5c8271c2eaa7ca91ad1c92c691d8bc (diff)
downloadmeowcraft-23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a.tar.zst
meowcraft-23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a.zip
Extremely simple chunk-limited lighting
Diffstat (limited to 'src/World/Chunk.hpp')
-rw-r--r--src/World/Chunk.hpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp
index bc44137..5f4844e 100644
--- a/src/World/Chunk.hpp
+++ b/src/World/Chunk.hpp
@@ -4,7 +4,6 @@
 #include "BiomeType.hpp"
 #include "BlockType.hpp"
 #include "../GFX/Mesh.hpp"
-#include "BlockSide.hpp"
 
 namespace MC::World {
 
@@ -18,13 +17,18 @@ public:
         m_position{(Real)x * Width, 0.0f, (Real)y * Width} {}
 
     struct BlockData {
+        BlockData() : type(BlockType::Air) {}
+        BlockData(BlockType t) : type(t), light{} {}
+
         BlockType type;
+        U8 light;
 
         Bool empty() const { return type == BlockType::Air; }
     };
 
-    void set(U32 x, U32 y, U32 z, BlockData data);
-    BlockData get(U32 x, U32 y, U32 z) const;
+    const BlockData& at(U32 x, U32 y, U32 z) const;
+    BlockData& at(U32 x, U32 y, U32 z);
+
     Bool is_empty(U32 x, U32 y, U32 z) const;
 
     struct Details {