make chunk lightmap optional
This commit is contained in:
+2
-10
@@ -8,7 +8,8 @@
|
||||
#include "util/data_io.hpp"
|
||||
#include "voxel.hpp"
|
||||
|
||||
Chunk::Chunk(int xpos, int zpos) : x(xpos), z(zpos) {
|
||||
Chunk::Chunk(int xpos, int zpos, std::shared_ptr<Lightmap> lightmap)
|
||||
: x(xpos), z(zpos), lightmap(std::move(lightmap)) {
|
||||
bottom = 0;
|
||||
top = CHUNK_H;
|
||||
}
|
||||
@@ -56,15 +57,6 @@ std::shared_ptr<Inventory> Chunk::getBlockInventory(uint x, uint y, uint z)
|
||||
return found->second;
|
||||
}
|
||||
|
||||
std::unique_ptr<Chunk> Chunk::clone() const {
|
||||
auto other = std::make_unique<Chunk>(x, z);
|
||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
||||
other->voxels[i] = voxels[i];
|
||||
}
|
||||
other->lightmap.set(&lightmap);
|
||||
return other;
|
||||
}
|
||||
|
||||
/**
|
||||
Current chunk format:
|
||||
- byte-order: little-endian
|
||||
|
||||
Reference in New Issue
Block a user