EngineSettings: chunksLoadDistance, chunksPadding

This commit is contained in:
MihailRis
2023-11-06 01:47:17 +03:00
parent 26935473a3
commit 01eb264f44
12 changed files with 79 additions and 53 deletions
+3 -3
View File
@@ -36,14 +36,14 @@ void World::write(Level* level) {
wfile->writePlayer(level->player);
}
Level* World::loadLevel(Player* player) {
Level* World::loadLevel(Player* player, uint loadDistance, uint chunksPadding) {
ChunksStorage* storage = new ChunksStorage();
LevelEvents* events = new LevelEvents();
Level* level = new Level(this, player, new Chunks(16, 16, 0, 0, events), storage, new PhysicsSolver(vec3(0, -19.6f, 0)), events);
Level* level = new Level(this, player, storage, events, loadDistance, chunksPadding);
wfile->readPlayer(player);
Camera* camera = player->camera;
camera->rotation = mat4(1.0f);
camera->rotate(player->camY, player->camX, 0);
return level;
}
}