mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
Sky lights data saving (optimization)
This commit is contained in:
parent
6b423b441f
commit
a102821076
12 changed files with 147 additions and 38 deletions
|
|
@ -21,8 +21,10 @@ World::World(string name,
|
|||
path directory,
|
||||
uint64_t seed,
|
||||
EngineSettings& settings)
|
||||
: name(name), seed(seed) {
|
||||
wfile = new WorldFiles(directory, settings.debug.generatorTestMode);
|
||||
: settings(settings),
|
||||
name(name),
|
||||
seed(seed) {
|
||||
wfile = new WorldFiles(directory, settings.debug);
|
||||
}
|
||||
|
||||
World::~World(){
|
||||
|
|
@ -41,7 +43,10 @@ void World::write(Level* level) {
|
|||
|
||||
for (size_t i = 0; i < chunks->volume; i++) {
|
||||
shared_ptr<Chunk> chunk = chunks->chunks[i];
|
||||
if (chunk == nullptr || !chunk->isUnsaved())
|
||||
if (chunk == nullptr)
|
||||
continue;
|
||||
bool lightsUnsaved = !chunk->isLoadedLights() && settings.debug.doWriteLights;
|
||||
if (!chunk->isUnsaved() && !lightsUnsaved)
|
||||
continue;
|
||||
wfile->put(chunk.get());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue