New world format, fixes
This commit is contained in:
+13
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user