summaryrefslogtreecommitdiff
path: root/src/factories/mk64/TrackSections.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/factories/mk64/TrackSections.h')
-rw-r--r--src/factories/mk64/TrackSections.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/factories/mk64/TrackSections.h b/src/factories/mk64/TrackSections.h
new file mode 100644
index 0000000..05e1ee4
--- /dev/null
+++ b/src/factories/mk64/TrackSections.h
@@ -0,0 +1,49 @@
+#pragma once
+
+#include "../BaseFactory.h"
+
+namespace MK64 {
+
+ struct TrackSections {
+ uint32_t addr;
+ uint8_t surfaceType;
+ uint8_t sectionId;
+ uint16_t flags;
+ };
+
+ class TrackSectionsData : public IParsedData {
+ public:
+ std::vector<TrackSections> mSecs;
+
+ explicit TrackSectionsData(std::vector<TrackSections> sections) : mSecs(sections) {}
+ };
+
+ class TrackSectionsHeaderExporter : public BaseExporter {
+ void Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
+ };
+
+ class TrackSectionsBinaryExporter : public BaseExporter {
+ void Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
+ };
+
+ class TrackSectionsCodeExporter : public BaseExporter {
+ void Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
+ };
+
+ class TrackSectionsFactory : public BaseFactory {
+ public:
+ std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data) override;
+ std::optional<std::shared_ptr<IParsedData>> parse_modding(std::vector<uint8_t>& buffer, YAML::Node& data) override {
+ return std::nullopt;
+ }
+ inline std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
+ return {
+ REGISTER(Code, TrackSectionsCodeExporter)
+ REGISTER(Header, TrackSectionsHeaderExporter)
+ REGISTER(Binary, TrackSectionsBinaryExporter)
+ };
+ }
+ bool SupportModdedAssets() override { return false; }
+ };
+
+} \ No newline at end of file