diff options
| author | briaguya <70942617+briaguya0@users.noreply.github.com> | 2026-07-24 18:09:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-24 18:09:55 -0400 |
| commit | 4cae44160693e1beb562e39dc301bd42278be1f9 (patch) | |
| tree | 5d247f7821a6040221b4bf34d2cae2b87c42d23a /src/factories/DisplayListFactory.cpp | |
| parent | cd33252589a61d044138f449041a87adee2a8291 (diff) | |
oot support (#219)
Diffstat (limited to 'src/factories/DisplayListFactory.cpp')
| -rw-r--r-- | src/factories/DisplayListFactory.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp index 2d6d48e..2e336f0 100644 --- a/src/factories/DisplayListFactory.cpp +++ b/src/factories/DisplayListFactory.cpp @@ -6,6 +6,9 @@ #include <fstream> #include <tuple> #include "n64/gbi-otr.h" +#ifdef OOT_SUPPORT +#include "oot/OoTDListHelpers.h" +#endif #ifdef STANDALONE #include <gfxd.h> @@ -196,6 +199,11 @@ void DebugDisplayList(uint32_t w0, uint32_t w1) { #endif std::optional<std::tuple<std::string, YAML::Node>> SearchVtx(uint32_t ptr) { +#ifdef OOT_SUPPORT + auto result = OoT::DListHelpers::SearchVtx(ptr); + if (result.has_value()) return result; +#endif + const auto* decs = Companion::Instance->GetNodesByTypeRef("VTX", Companion::Instance->GetConfig().includeAutogen); if (decs == nullptr) { return std::nullopt; @@ -230,6 +238,11 @@ std::optional<std::tuple<std::string, YAML::Node>> SearchVtx(uint32_t ptr) { ExportResult DListBinaryExporter::Export(std::ostream& write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node& node, std::string* replacement) { +#ifdef OOT_SUPPORT + auto ootResult = OoT::DListHelpers::Export(write, raw, entryName, node, replacement); + if (ootResult.has_value()) return ootResult.value(); +#endif + const auto gbi = Companion::Instance->GetGBIVersion(); auto cmds = std::static_pointer_cast<DListData>(raw)->mGfxs; auto writer = LUS::BinaryWriter(); @@ -511,6 +524,11 @@ ExportResult DListBinaryExporter::Export(std::ostream& write, std::shared_ptr<IP } std::optional<std::shared_ptr<IParsedData>> DListFactory::parse(std::vector<uint8_t>& raw_buffer, YAML::Node& node) { +#ifdef OOT_SUPPORT + auto ootResult = OoT::DListHelpers::Parse(raw_buffer, node); + if (ootResult.has_value()) return ootResult.value(); +#endif + const auto gbi = Companion::Instance->GetGBIVersion(); auto count = GetSafeNode<int32_t>(node, "count", -1); |
