mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
feat: saving entities (WIP)
This commit is contained in:
parent
019a88ef84
commit
f0270d3391
24 changed files with 290 additions and 101 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue