diff options
| author | Lywx <kiritodev01@gmail.com> | 2024-03-20 21:17:11 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-20 21:17:11 -0600 |
| commit | f0c70f855a892ca7dc21cee4b4037dad983adb8f (patch) | |
| tree | f15cc271b00166476a2e7b780e50d911770a7316 /src/factories/mk64/CourseVtx.cpp | |
| parent | 8465919ab7aba6cfde7d25ad1731673e5da01642 (diff) | |
Auto pad and overlap detection (#47)
* Fully implemented pad and overlap detection
* Cleaned code, fixed pad generation and added alignment
* Added debug size on pads
Diffstat (limited to 'src/factories/mk64/CourseVtx.cpp')
| -rw-r--r-- | src/factories/mk64/CourseVtx.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/factories/mk64/CourseVtx.cpp b/src/factories/mk64/CourseVtx.cpp index 5570616..524ae6b 100644 --- a/src/factories/mk64/CourseVtx.cpp +++ b/src/factories/mk64/CourseVtx.cpp @@ -6,18 +6,19 @@ #define NUM(x) std::dec << std::setfill(' ') << std::setw(6) << x #define COL(c) "0x" << std::hex << std::setw(2) << std::setfill('0') << c -void MK64::CourseVtxHeaderExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement) { +ExportResult MK64::CourseVtxHeaderExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement) { const auto symbol = GetSafeNode(node, "symbol", entryName); if(Companion::Instance->IsOTRMode()){ write << "static const char " << symbol << "[] = \"__OTR__" << (*replacement) << "\";\n\n"; - return; + return std::nullopt; } write << "extern CourseVtx " << symbol << "[];\n"; + return std::nullopt; } -void MK64::CourseVtxCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { +ExportResult MK64::CourseVtxCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { auto vtx = std::static_pointer_cast<CourseVtxData>(raw)->mVtxs; const auto symbol = GetSafeNode(node, "symbol", entryName); const auto offset = GetSafeNode<uint32_t>(node, "offset"); @@ -56,9 +57,10 @@ void MK64::CourseVtxCodeExporter::Export(std::ostream &write, std::shared_ptr<IP } write << "};\n\n"; + return std::nullopt; } -void MK64::CourseVtxBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { +ExportResult MK64::CourseVtxBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { auto vtx = std::static_pointer_cast<CourseVtxData>(raw); auto writer = LUS::BinaryWriter(); @@ -77,6 +79,7 @@ void MK64::CourseVtxBinaryExporter::Export(std::ostream &write, std::shared_ptr< } writer.Finish(write); + return std::nullopt; } std::optional<std::shared_ptr<IParsedData>> MK64::CourseVtxFactory::parse(std::vector<uint8_t>& buffer, YAML::Node& node) { |
