add core:obstacle block & move cameras from base to core & add new generator

This commit is contained in:
MihailRis
2024-09-25 15:45:45 +03:00
parent d534207deb
commit 788ad1f6a6
19 changed files with 147 additions and 114 deletions
+12 -12
View File
@@ -528,6 +528,18 @@ void ContentLoader::load() {
}
}
fs::path resourcesFile = folder / fs::u8path("resources.json");
if (fs::exists(resourcesFile)) {
auto resRoot = files::read_json(resourcesFile);
for (const auto& [key, arr] : resRoot.asObject()) {
if (auto resType = ResourceType_from(key)) {
loadResources(*resType, arr);
} else {
logger.warning() << "unknown resource type: " << key;
}
}
}
if (!fs::is_regular_file(pack->getContentFile())) return;
auto root = files::read_json(pack->getContentFile());
@@ -723,18 +735,6 @@ void ContentLoader::load() {
}
}
}
fs::path resourcesFile = folder / fs::u8path("resources.json");
if (fs::exists(resourcesFile)) {
auto resRoot = files::read_json(resourcesFile);
for (const auto& [key, arr] : resRoot.asObject()) {
if (auto resType = ResourceType_from(key)) {
loadResources(*resType, arr);
} else {
logger.warning() << "unknown resource type: " << key;
}
}
}
}
void ContentLoader::loadResources(ResourceType type, const dv::value& list) {