cleanup
This commit is contained in:
@@ -13,19 +13,6 @@ Chunk::Chunk(int xpos, int zpos) : x(xpos), z(zpos) {
|
|||||||
top = CHUNK_H;
|
top = CHUNK_H;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Chunk::isEmpty() const {
|
|
||||||
int id = -1;
|
|
||||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
|
||||||
if (voxels[i].id != id) {
|
|
||||||
if (id != -1)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
id = voxels[i].id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Chunk::updateHeights() {
|
void Chunk::updateHeights() {
|
||||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
for (uint i = 0; i < CHUNK_VOL; i++) {
|
||||||
if (voxels[i].id != 0) {
|
if (voxels[i].id != 0) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "maths/aabb.hpp"
|
#include "maths/aabb.hpp"
|
||||||
#include "voxel.hpp"
|
#include "voxel.hpp"
|
||||||
|
|
||||||
|
/// @brief Total bytes number of chunk voxel data
|
||||||
inline constexpr int CHUNK_DATA_LEN = CHUNK_VOL * 4;
|
inline constexpr int CHUNK_DATA_LEN = CHUNK_VOL * 4;
|
||||||
|
|
||||||
class ContentReport;
|
class ContentReport;
|
||||||
@@ -45,8 +46,7 @@ public:
|
|||||||
|
|
||||||
Chunk(int x, int z);
|
Chunk(int x, int z);
|
||||||
|
|
||||||
bool isEmpty() const;
|
/// @brief Refresh `bottom` and `top` values
|
||||||
|
|
||||||
void updateHeights();
|
void updateHeights();
|
||||||
|
|
||||||
// unused
|
// unused
|
||||||
|
|||||||
Reference in New Issue
Block a user