New world format, fixes

This commit is contained in:
MihailRis 2023-11-05 15:32:46 +03:00 • committed by GitHub
parent 0c65b13f4e
commit 0cf8382e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 350 additions and 173 deletions

View file

@ -17,6 +17,7 @@
#include "voxels/Block.h"
#include "world/World.h"
#include "world/Level.h"
#include "world/LevelEvents.h"
#include "objects/Player.h"
#include "Assets.h"
#include "player_control.h"
@ -30,6 +31,9 @@ WorldRenderer::WorldRenderer(Level* level, Assets* assets) : assets(assets), lev
lineBatch = new LineBatch(4096);
batch3d = new Batch3D(1024);
renderer = new ChunksRenderer(level);
level->events->listen(EVT_CHUNK_HIDDEN, [this](lvl_event_type type, Chunk* chunk) {
renderer->unload(chunk);
});
}
WorldRenderer::~WorldRenderer() {