2022-11-10 19:47:39 +01:00
|
|
|
#ifndef CHUNKMANAGER_H
|
|
|
|
#define CHUNKMANAGER_H
|
|
|
|
|
2023-03-13 13:33:32 +01:00
|
|
|
// Second to be passed outside of render distance for a chunk to be destroyed
|
|
|
|
#define UNLOAD_TIMEOUT 10
|
|
|
|
|
2023-03-03 21:33:11 +01:00
|
|
|
#include <thread>
|
|
|
|
|
2022-11-10 19:47:39 +01:00
|
|
|
namespace chunkmanager
|
|
|
|
{
|
2023-03-03 21:33:11 +01:00
|
|
|
std::thread initGenThread();
|
|
|
|
std::thread initMeshThread();
|
2023-03-07 21:37:28 +01:00
|
|
|
void stopGenThread();
|
|
|
|
void stopMeshThread();
|
|
|
|
|
2022-11-10 19:47:39 +01:00
|
|
|
void update(float deltaTime);
|
2023-03-07 21:37:28 +01:00
|
|
|
|
2022-11-10 19:47:39 +01:00
|
|
|
void updateChunk(uint32_t, uint16_t, uint16_t, uint16_t);
|
2022-11-11 20:36:39 +01:00
|
|
|
void destroy();
|
2023-03-03 21:33:11 +01:00
|
|
|
|
2023-03-20 22:57:29 +01:00
|
|
|
void blockpick(bool place);
|
|
|
|
uint32_t calculateIndex(uint16_t i, uint16_t j, uint16_t k);
|
|
|
|
|
2023-03-03 21:33:11 +01:00
|
|
|
void mesh();
|
|
|
|
void generate();
|
2023-03-07 21:37:28 +01:00
|
|
|
|
2022-11-10 19:47:39 +01:00
|
|
|
}
|
|
|
|
|
2023-03-07 21:37:28 +01:00
|
|
|
#endif
|