mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
add automatic biome-based structures placement
This commit is contained in:
parent
323c2f2935
commit
806ed4b155
8 changed files with 174 additions and 106 deletions
|
|
@ -89,7 +89,7 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
|||
}
|
||||
|
||||
for (auto& [name, def] : content->generators.getDefs()) {
|
||||
def->script->prepare(content.get());
|
||||
def->script->prepare(*def, content.get());
|
||||
}
|
||||
|
||||
return content;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,12 @@ static std::vector<std::unique_ptr<GeneratingVoxelStructure>> load_structures(
|
|||
}
|
||||
|
||||
static void load_structures(GeneratorDef& def, const fs::path& structuresFile) {
|
||||
def.structures = load_structures(structuresFile);
|
||||
auto rawStructures = load_structures(structuresFile);
|
||||
def.structures.resize(rawStructures.size());
|
||||
|
||||
for (int i = 0; i < rawStructures.size(); i++) {
|
||||
def.structures[i] = std::move(rawStructures[i]);
|
||||
}
|
||||
// build indices map
|
||||
for (size_t i = 0; i < def.structures.size(); i++) {
|
||||
auto& structure = def.structures[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue