mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
Added generation seed support
This commit is contained in:
parent
37dd882fdb
commit
1038a79b78
11 changed files with 25 additions and 17 deletions
|
|
@ -2,12 +2,12 @@
|
|||
#include "../lighting/Lighting.h"
|
||||
#include "../voxels/ChunksController.h"
|
||||
|
||||
Level::Level(Player* player, Chunks* chunks, PhysicsSolver* physics) :
|
||||
Level::Level(World* world, Player* player, Chunks* chunks, PhysicsSolver* physics) :
|
||||
player(player),
|
||||
chunks(chunks),
|
||||
physics(physics) {
|
||||
lighting = new Lighting(chunks);
|
||||
chunksController = new ChunksController(chunks, lighting);
|
||||
chunksController = new ChunksController(world, chunks, lighting);
|
||||
}
|
||||
|
||||
Level::~Level(){
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef WORLD_LEVEL_H_
|
||||
#define WORLD_LEVEL_H_
|
||||
|
||||
class World;
|
||||
class Player;
|
||||
class Chunks;
|
||||
class Lighting;
|
||||
|
|
@ -14,7 +15,7 @@ public:
|
|||
PhysicsSolver* physics;
|
||||
Lighting* lighting;
|
||||
ChunksController* chunksController;
|
||||
Level(Player* player, Chunks* chunks, PhysicsSolver* physics);
|
||||
Level(World* world, Player* player, Chunks* chunks, PhysicsSolver* physics);
|
||||
~Level();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "../voxels/Chunk.h"
|
||||
#include "../voxels/Chunks.h"
|
||||
|
||||
World::World(std::string name, std::string directory) : name(name) {
|
||||
World::World(std::string name, std::string directory, int seed) : name(name), seed(seed) {
|
||||
wfile = new WorldFiles(directory, REGION_VOL * (CHUNK_VOL * 2 + 8));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ class World {
|
|||
public:
|
||||
std::string name;
|
||||
WorldFiles* wfile;
|
||||
int seed;
|
||||
|
||||
World(std::string name, std::string directory);
|
||||
World(std::string name, std::string directory, int seed);
|
||||
~World();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue