Generator test mode setting

This commit is contained in:
MihailRis
2023-11-15 00:06:28 +03:00
parent ccbfaa3a86
commit 91c06537eb
13 changed files with 67 additions and 105 deletions
+4 -1
View File
@@ -20,7 +20,10 @@ Level::Level(World* world, Player* player, ChunksStorage* chunksStorage, LevelEv
uint matrixSize = (settings.chunks.loadDistance+
settings.chunks.padding) * 2;
chunks = new Chunks(matrixSize, matrixSize, 0, 0, world->wfile, events);
chunks = new Chunks(matrixSize, matrixSize,
0, 0,
world->wfile,
events);
lighting = new Lighting(chunks);
chunksController = new ChunksController(this, chunks, lighting, settings.chunks.padding);
playerController = new PlayerController(this, settings);
+3 -3
View File
@@ -14,15 +14,15 @@
using std::shared_ptr;
World::World(std::string name, std::string directory, int seed) : name(name), seed(seed) {
wfile = new WorldFiles(directory, REGION_VOL * (CHUNK_DATA_LEN * 2 + 8));
World::World(std::string name, std::string directory, int seed, EngineSettings& settings) : name(name), seed(seed) {
wfile = new WorldFiles(directory, REGION_VOL * (CHUNK_DATA_LEN * 2 + 8), settings.debug.generatorTestMode);
}
World::~World(){
delete wfile;
}
void World::write(Level* level) {
void World::write(Level* level, bool writeChunks) {
Chunks* chunks = level->chunks;
for (size_t i = 0; i < chunks->volume; i++) {
+2 -2
View File
@@ -16,10 +16,10 @@ public:
WorldFiles* wfile;
int seed;
World(std::string name, std::string directory, int seed);
World(std::string name, std::string directory, int seed, EngineSettings& settings);
~World();
void write(Level* level);
void write(Level* level, bool writeChunks);
Level* loadLevel(Player* player, EngineSettings& settings);
};