mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
New world format, fixes
This commit is contained in:
parent
0c65b13f4e
commit
0cf8382e95
21 changed files with 350 additions and 173 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#include "Level.h"
|
||||
#include "World.h"
|
||||
#include "LevelEvents.h"
|
||||
#include "../lighting/Lighting.h"
|
||||
#include "../voxels/Chunk.h"
|
||||
#include "../voxels/Chunks.h"
|
||||
#include "../voxels/ChunksController.h"
|
||||
#include "../voxels/ChunksStorage.h"
|
||||
|
|
@ -9,19 +11,24 @@
|
|||
#include "../physics/PhysicsSolver.h"
|
||||
#include "../objects/Player.h"
|
||||
|
||||
Level::Level(World* world, Player* player, Chunks* chunks, ChunksStorage* chunksStorage, PhysicsSolver* physics) :
|
||||
world(world),
|
||||
player(player),
|
||||
chunks(chunks),
|
||||
chunksStorage(chunksStorage),
|
||||
physics(physics) {
|
||||
Level::Level(World* world, Player* player, Chunks* chunks, ChunksStorage* chunksStorage, PhysicsSolver* physics, LevelEvents* events) :
|
||||
world(world),
|
||||
player(player),
|
||||
chunks(chunks),
|
||||
chunksStorage(chunksStorage),
|
||||
physics(physics),
|
||||
events(events) {
|
||||
lighting = new Lighting(chunks);
|
||||
chunksController = new ChunksController(this, chunks, lighting);
|
||||
playerController = new PlayerController(this);
|
||||
events->listen(EVT_CHUNK_HIDDEN, [this](lvl_event_type type, Chunk* chunk) {
|
||||
this->chunksStorage->remove(chunk->x, chunk->z);
|
||||
});
|
||||
}
|
||||
|
||||
Level::~Level(){
|
||||
delete chunks;
|
||||
delete events;
|
||||
delete physics;
|
||||
delete player;
|
||||
delete lighting;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue