summaryrefslogtreecommitdiff
path: root/src/factories/sf64/AnimFactory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/factories/sf64/AnimFactory.h')
-rw-r--r--src/factories/sf64/AnimFactory.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/factories/sf64/AnimFactory.h b/src/factories/sf64/AnimFactory.h
new file mode 100644
index 0000000..28f88d8
--- /dev/null
+++ b/src/factories/sf64/AnimFactory.h
@@ -0,0 +1,48 @@
+#pragma once
+
+#include "../BaseFactory.h"
+
+struct JointKey {
+ uint16_t keys[6];
+};
+
+class AnimData : public IParsedData {
+public:
+ int16_t mFrameCount;
+ int16_t mLimbCount;
+ uint32_t mDataOffset;
+ uint32_t mKeyOffset;
+ std::vector<int16_t> mFrameData;
+ std::vector<JointKey> mJointKeys;
+
+
+ AnimData(int16_t frameCount, int16_t limbCount, uint32_t dataOffset, std::vector<int16_t> frameData, uint32_t keyOffset, std::vector<JointKey> jointKeys);
+};
+
+class AnimHeaderExporter : public BaseExporter {
+ void Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
+};
+
+class AnimBinaryExporter : public BaseExporter {
+ void Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
+};
+
+class AnimCodeExporter : public BaseExporter {
+ void Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
+};
+
+class AnimFactory : 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, AnimCodeExporter)
+ REGISTER(Header, AnimHeaderExporter)
+ REGISTER(Binary, AnimBinaryExporter)
+ };
+ }
+ bool SupportModdedAssets() override { return false; }
+}; \ No newline at end of file