mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
1st attempt at removing recursive processing
This commit is contained in:
+8
-19
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user