feat: saving entities (WIP)
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ Level::Level(
|
||||
settings.chunks.padding.get()
|
||||
) * 2;
|
||||
chunks = std::make_unique<Chunks>(
|
||||
matrixSize, matrixSize, 0, 0, this->world->wfile.get(), events.get(), content
|
||||
matrixSize, matrixSize, 0, 0, this->world->wfile.get(), this
|
||||
);
|
||||
lighting = std::make_unique<Lighting>(content, chunks.get());
|
||||
|
||||
|
||||
+1
-8
@@ -51,14 +51,7 @@ void World::updateTimers(float delta) {
|
||||
|
||||
void World::write(Level* level) {
|
||||
const Content* content = level->content;
|
||||
Chunks* chunks = level->chunks.get();
|
||||
auto& regions = wfile->getRegions();
|
||||
|
||||
for (size_t i = 0; i < chunks->volume; i++) {
|
||||
if (auto chunk = chunks->chunks[i]) {
|
||||
regions.put(chunk.get());
|
||||
}
|
||||
}
|
||||
level->chunks->saveAll();
|
||||
wfile->write(this, content);
|
||||
auto playerFile = dynamic::Map();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user