From f0c70f855a892ca7dc21cee4b4037dad983adb8f Mon Sep 17 00:00:00 2001 From: Lywx Date: Wed, 20 Mar 2024 21:17:11 -0600 Subject: 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 --- src/factories/mk64/Waypoints.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/factories/mk64/Waypoints.cpp') diff --git a/src/factories/mk64/Waypoints.cpp b/src/factories/mk64/Waypoints.cpp index 9149fb6..81e6b36 100644 --- a/src/factories/mk64/Waypoints.cpp +++ b/src/factories/mk64/Waypoints.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::WaypointHeaderExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement) { +ExportResult MK64::WaypointHeaderExporter::Export(std::ostream &write, std::shared_ptr 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 TrackWaypoint " << symbol << "[];\n"; + return std::nullopt; } -void MK64::WaypointCodeExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { +ExportResult MK64::WaypointCodeExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { auto waypoints = std::static_pointer_cast(raw)->mWaypoints; auto symbol = GetSafeNode(node, "symbol", entryName); @@ -39,9 +40,10 @@ void MK64::WaypointCodeExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { +ExportResult MK64::WaypointBinaryExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { auto waypoints = std::static_pointer_cast(raw)->mWaypoints; auto writer = LUS::BinaryWriter(); @@ -55,6 +57,7 @@ void MK64::WaypointBinaryExporter::Export(std::ostream &write, std::shared_ptr> MK64::WaypointsFactory::parse(std::vector& buffer, YAML::Node& node) { -- cgit v1.2.3