1st attempt at removing recursive processing

This commit is contained in:
KiritoDv
2025-01-03 14:14:57 -06:00
committed by Lywx
parent 0d9da40626
commit b5435b199a
3 changed files with 12 additions and 21 deletions
+8 -19
View File
@@ -282,23 +282,6 @@ std::optional<ParseResultData> Companion::ParseNode(YAML::Node& node, std::strin
return std::nullopt;
}
for (auto [fst, snd] : this->gAssetDependencies[this->gCurrentFile]) {
if(snd.second) {
continue;
}
std::string doutput = (this->gCurrentDirectory / fst).string();
std::replace(doutput.begin(), doutput.end(), '\\', '/');
this->gAssetDependencies[this->gCurrentFile][fst].second = true;
auto dResult = this->ParseNode(snd.first, doutput);
if(dResult.has_value()) {
this->gParseResults[this->gCurrentFile].push_back(dResult.value());
}
spdlog::set_pattern(regular);
SPDLOG_INFO("------------------------------------------------");
spdlog::set_pattern(line);
}
SPDLOG_INFO("Processed {}", name);
return ParseResultData {
@@ -1267,13 +1250,19 @@ std::optional<std::tuple<std::string, YAML::Node>> Companion::RegisterAsset(cons
return std::nullopt;
}
this->gAssetDependencies[this->gCurrentFile][name] = std::make_pair(node, false);
auto output = (this->gCurrentDirectory / name).string();
std::replace(output.begin(), output.end(), '\\', '/');
auto entry = std::make_tuple(output, node);
this->gAddrMap[this->gCurrentFile][node["offset"].as<uint32_t>()] = entry;
this->gAssetDependencies[this->gCurrentFile][name] = std::make_pair(node, true);
auto dResult = this->ParseNode(node, output);
if(dResult.has_value()) {
this->gParseResults[this->gCurrentFile].push_back(dResult.value());
}
spdlog::set_pattern(regular);
SPDLOG_INFO("------------------------------------------------");
spdlog::set_pattern(line);
return entry;
}
+2
View File
@@ -540,6 +540,8 @@ std::optional<std::shared_ptr<IParsedData>> DListFactory::parse(std::vector<uint
light = true;
}
break;
default:
throw std::runtime_error("Unsupported GBI version");
}
if(light){
+2 -2
View File
@@ -178,7 +178,7 @@ int Viewport(uint32_t ptr) {
return 1;
}
SPDLOG_WARN("Could not find viewport to override at 0x{:X}", ptr);
SPDLOG_TRACE("Could not find viewport to override at 0x{:X}", ptr);
return 0;
}
@@ -188,7 +188,7 @@ std::optional<std::tuple<std::string, YAML::Node>> GetVtxOverlap(uint32_t ptr){
return mVtxOverlaps[ptr];
}
SPDLOG_INFO("Failed to find overlap for ptr 0x{:X}", ptr);
SPDLOG_TRACE("Failed to find overlap for ptr 0x{:X}", ptr);
return std::nullopt;
}