summaryrefslogtreecommitdiff
path: root/src/chunk.hpp
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-09-30 15:40:42 -0400
committertylermurphy534 <tylermurphy534@gmail.com>2022-09-30 15:40:42 -0400
commit5585b67a272704e136abe830c336603098914415 (patch)
tree6a154b6c71fc5d1dcd57fc391a6384c60b190da8 /src/chunk.hpp
parentgreedy mesh texturing (diff)
downloadminecraftvulkan-5585b67a272704e136abe830c336603098914415.tar.gz
minecraftvulkan-5585b67a272704e136abe830c336603098914415.tar.bz2
minecraftvulkan-5585b67a272704e136abe830c336603098914415.zip
finalize greedy meshing
Diffstat (limited to 'src/chunk.hpp')
-rw-r--r--src/chunk.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/chunk.hpp b/src/chunk.hpp
index 59df514..33cab10 100644
--- a/src/chunk.hpp
+++ b/src/chunk.hpp
@@ -14,6 +14,7 @@
#include <string>
#include <map>
#include <algorithm>
+#include <cstdlib>
#define INVALID -1
#define AIR 0
@@ -68,6 +69,7 @@ class Chunk {
void setBlock(int32_t x, int32_t y, int32_t z, uint8_t block);
static bool isGenerated(int32_t gridX, int32_t gridZ);
+ static bool isMeshed(int32_t gridX, int32_t gridZ);
const int32_t gridX, gridZ;
const uint32_t world_seed, chunk_seed;
@@ -77,14 +79,16 @@ class Chunk {
Chunk(int32_t gridX, int32_t gridZ, uint32_t world_seed);
~Chunk();
- bool generated{false};
- bool reload{false};
- bool working{false};
+ void resetThread();
+
+ bool generated;
+ bool reload;
+ bool finished;
xe::Model* chunkMesh;
xe::Model::Data vertexData;
std::vector<uint8_t> cubes{};
- std::thread worker;
+ std::thread* worker;
};