mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-05 15:19:07 +02:00
Collect biome data
We store the biome data as grayscale images, as biome indices are represented as bytes and we get PNG compression for free.
This commit is contained in:
parent
dc97c4a8c1
commit
f539d668eb
3 changed files with 81 additions and 23 deletions
|
@ -75,8 +75,10 @@ uint8_t Chunk::getBiome(size_t x, size_t y, size_t z) const {
|
|||
return biomeInts->getValue((y/BGROUP)*BSIZE*BSIZE + (z/BGROUP)*BSIZE + (x/BGROUP));
|
||||
else if (biomeIntsPre115)
|
||||
return biomeIntsPre115->getValue(z*SIZE + x);
|
||||
else
|
||||
else if (biomeBytes)
|
||||
return biomeBytes->getValue(z*SIZE + x);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Chunk::getBlock(Block *block, const Section *section, size_t x, size_t y, size_t z, uint8_t prev_light) const {
|
||||
|
|
|
@ -62,7 +62,6 @@ private:
|
|||
std::shared_ptr<const NBT::IntArrayTag> biomeIntsPre115;
|
||||
std::shared_ptr<const NBT::IntArrayTag> biomeInts;
|
||||
|
||||
uint8_t getBiome(size_t x, size_t y, size_t z) const;
|
||||
bool getBlock(Block *block, const Section *section, size_t x, size_t y, size_t z, uint8_t prev_light) const;
|
||||
|
||||
public:
|
||||
|
@ -72,6 +71,8 @@ public:
|
|||
return *level;
|
||||
}
|
||||
|
||||
uint8_t getBiome(size_t x, size_t y, size_t z) const;
|
||||
|
||||
const Resource::BlockType * getBlockStateAt(size_t x, size_t y, size_t z) const {
|
||||
size_t Y = y / SIZE;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue