add SurroundMap intergration to world generator (WIP)

This commit is contained in:
MihailRis
2024-09-11 11:35:56 +03:00
parent 80d8a6738b
commit 8268176527
6 changed files with 76 additions and 10 deletions
+8
View File
@@ -3,10 +3,12 @@
#include <string>
#include <memory>
#include <vector>
#include <unordered_map>
#include "constants.hpp"
#include "typedefs.hpp"
#include "voxels/voxel.hpp"
#include "SurroundMap.hpp"
class Content;
struct GeneratorDef;
@@ -42,6 +44,10 @@ class WorldGenerator {
const Content* content;
/// @param seed world seed
uint64_t seed;
/// @brief Chunk prototypes main storage
std::unordered_map<glm::ivec2, std::unique_ptr<ChunkPrototype>> prototypes;
/// @brief Chunk prototypes loading surround map
SurroundMap surroundMap;
/// @brief Generate chunk prototype (see ChunkPrototype)
/// @param x chunk position X divided by CHUNK_W
@@ -57,6 +63,8 @@ public:
);
virtual ~WorldGenerator() = default;
virtual void update(int centerX, int centerY, int loadDistance);
/// @brief Generate complete chunk voxels
/// @param voxels destinatiopn chunk voxels buffer
/// @param x chunk position X divided by CHUNK_W