Refactored vtx overlap function

This commit is contained in:
KiritoDv
2024-03-10 15:58:45 -06:00
committed by Lywx
parent c4bb1ad8ee
commit 5d4bd639df
6 changed files with 135 additions and 24 deletions
+21
View File
@@ -14,6 +14,7 @@
#include "factories/VtxFactory.h"
#include "factories/TextureFactory.h"
#include "factories/DisplayListFactory.h"
#include "factories/DisplayListOverrides.h"
#include "factories/BlobFactory.h"
#include "factories/LightsFactory.h"
#include "factories/mk64/CourseVtx.h"
@@ -482,6 +483,7 @@ void Companion::Process() {
this->gConfig.segment.local.clear();
this->gFileHeader.clear();
this->gCurrentPad = 0;
GFXDOverride::ClearVtx();
if(root[":config"]) {
this->ParseCurrentFileConfig(root[":config"]);
@@ -783,6 +785,25 @@ std::optional<std::tuple<std::string, YAML::Node>> Companion::GetNodeByAddr(cons
return this->gAddrMap[this->gCurrentFile][addr];
}
std::optional<std::vector<std::tuple<std::string, YAML::Node>>> Companion::GetNodesByType(const std::string& type){
std::vector<std::tuple<std::string, YAML::Node>> nodes;
if(!this->gAddrMap.contains(this->gCurrentFile)){
return nodes;
}
for(auto& [addr, tpl] : this->gAddrMap[this->gCurrentFile]){
auto [name, node] = tpl;
const auto n_type = GetSafeNode<std::string>(node, "type");
if(n_type == type){
nodes.push_back(tpl);
}
}
return nodes;
}
std::string Companion::NormalizeAsset(const std::string& name) const {
auto path = fs::path(this->gCurrentFile).stem().string() + "_" + name;
return path;