This commit is contained in:
MihailRis 2022-07-01 02:34:34 +03:00 committed by GitHub
parent 1038a79b78
commit b2872650d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ void update_level(World* world, Level* level, vec3 position, float delta, long f
}
Level* load_level(World* world, Player* player) {
Level* level = new Level(world, player, new Chunks(32,1,32, 0,0,0), new PhysicsSolver(vec3(0, -gravity, 0)));
Level* level = new Level(world, player, new Chunks(34,1,34, 0,0,0), new PhysicsSolver(vec3(0, -gravity, 0)));
world->wfile->readPlayer(player);
Camera* camera = player->camera;

View File

@ -33,7 +33,7 @@ void ChunksLoader::_thread(){
if (state == LOAD){
chunks.putChunk(chunk);
if (!chunk->loaded){
WorldGenerator::generate(chunk->voxels, chunk->x, chunk->y, chunk->z, world.load()->seed);
WorldGenerator::generate(chunk->voxels, chunk->x, chunk->y, chunk->z, world->seed);
}
lighting.onChunkLoaded(chunk->x, chunk->y, chunk->z, true);

View File

@ -23,8 +23,8 @@ private:
void _thread();
std::atomic<Chunk*> current {nullptr};
std::atomic<Chunk**> closes {nullptr};
std::atomic<World*> world {nullptr};
std::atomic<LoaderMode> state {IDLE};
World* world;
void perform(Chunk* chunk, Chunk** closes_passed, LoaderMode mode);
public: