mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
feat: loading entities (WIP)
This commit is contained in:
parent
08cc78289d
commit
c8666910ce
16 changed files with 129 additions and 38 deletions
|
|
@ -94,8 +94,8 @@ static std::tuple<size_t, std::unique_ptr<RigNode>> read_node(
|
|||
size_t count = 1;
|
||||
if (auto nodesList = root->list("nodes")) {
|
||||
for (size_t i = 0; i < nodesList->size(); i++) {
|
||||
if (auto map = nodesList->map(i)) {
|
||||
auto [subcount, subNode] = read_node(map, index+count);
|
||||
if (const auto& map = nodesList->map(i)) {
|
||||
auto [subcount, subNode] = read_node(map.get(), index+count);
|
||||
subcount += count;
|
||||
subnodes.push_back(std::move(subNode));
|
||||
}
|
||||
|
|
@ -114,6 +114,6 @@ std::unique_ptr<RigConfig> RigConfig::parse(
|
|||
if (rootNodeMap == nullptr) {
|
||||
throw std::runtime_error("missing 'root' element");
|
||||
}
|
||||
auto [count, rootNode] = read_node(rootNodeMap, 0);
|
||||
auto [count, rootNode] = read_node(rootNodeMap.get(), 0);
|
||||
return std::make_unique<RigConfig>(std::string(name), std::move(rootNode), count);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue