Torch
Loading...
Searching...
No Matches
VtxFactory.h
1#pragma once
2
3#include "BaseFactory.h"
4
5struct VtxRaw {
6 int16_t ob[3]; /* x, y, z */
7 uint16_t flag;
8 int16_t tc[2]; /* texture coord */
9 uint8_t cn[4]; /* color & alpha */
10};
11
12class VtxData : public IParsedData {
13public:
14 std::vector<VtxRaw> mVtxs;
15
16 explicit VtxData(std::vector<VtxRaw> vtxs) : mVtxs(vtxs) {}
17};
18
20 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
21};
22
24 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
25};
26
28 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
29};
30
31class VtxFactory : public BaseFactory {
32public:
33 std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data) override;
34 inline std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
35 return {
36 REGISTER(Code, VtxCodeExporter)
37 REGISTER(Header, VtxHeaderExporter)
38 REGISTER(Binary, VtxBinaryExporter)
39 };
40 }
41 uint32_t GetAlignment() override {
42 return 8;
43 };
44};
Definition BaseFactory.h:88
Definition BaseFactory.h:94
Definition BaseFactory.h:80
Definition VtxFactory.h:23
Definition VtxFactory.h:27
Definition VtxFactory.h:31
Definition VtxFactory.h:19
Definition VtxFactory.h:5