mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add dv::merge & update EnginePaths::readCombinedObject
This commit is contained in:
parent
12105c2933
commit
84d5b5d1a8
5 changed files with 52 additions and 6 deletions
|
|
@ -253,7 +253,7 @@ dv::value ResPaths::readCombinedList(const std::string& filename) const {
|
|||
return list;
|
||||
}
|
||||
|
||||
dv::value ResPaths::readCombinedObject(const std::string& filename) const {
|
||||
dv::value ResPaths::readCombinedObject(const std::string& filename, bool deep) const {
|
||||
dv::value object = dv::object();
|
||||
for (const auto& root : roots) {
|
||||
auto path = root.path / filename;
|
||||
|
|
@ -267,9 +267,7 @@ dv::value ResPaths::readCombinedObject(const std::string& filename) const {
|
|||
<< "reading combined object " << root.name << ": "
|
||||
<< filename << " is not an object (skipped)";
|
||||
}
|
||||
for (const auto& [key, element] : value.asObject()) {
|
||||
object[key] = element;
|
||||
}
|
||||
object.merge(std::move(value), deep);
|
||||
} catch (const std::runtime_error& err) {
|
||||
logger.warning() << "reading combined object " << root.name << ":"
|
||||
<< filename << ": " << err.what();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue