make chunk lightmap optional

This commit is contained in:
MihailRis
2025-11-23 15:22:18 +03:00
parent 64f7c19766
commit 5250c748be
12 changed files with 103 additions and 73 deletions
+2 -5
View File
@@ -27,7 +27,7 @@ public:
int x, z;
int bottom, top;
voxel voxels[CHUNK_VOL] {};
Lightmap lightmap;
std::shared_ptr<Lightmap> lightmap;
struct {
bool modified : 1;
bool ready : 1;
@@ -45,14 +45,11 @@ public:
/// @brief Blocks metadata heap
BlocksMetadata blocksMetadata;
Chunk(int x, int z);
Chunk(int x, int z, std::shared_ptr<Lightmap> lightmap=nullptr);
/// @brief Refresh `bottom` and `top` values
void updateHeights();
// unused
std::unique_ptr<Chunk> clone() const;
/// @brief Creates new block inventory given size
/// @return inventory id or 0 if block does not exists
void addBlockInventory(