Torch
Loading...
Searching...
No Matches
VtxFactory.h
1
#pragma once
2
3
#include "BaseFactory.h"
4
5
struct
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
12
class
VtxData :
public
IParsedData
{
13
public
:
14
std::vector<VtxRaw> mVtxs;
15
16
explicit
VtxData(std::vector<VtxRaw> vtxs) : mVtxs(vtxs) {}
17
};
18
19
class
VtxHeaderExporter
:
public
BaseExporter
{
20
ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement)
override
;
21
};
22
23
class
VtxBinaryExporter
:
public
BaseExporter
{
24
ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement)
override
;
25
};
26
27
class
VtxCodeExporter
:
public
BaseExporter
{
28
ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement)
override
;
29
};
30
31
class
VtxFactory
:
public
BaseFactory
{
32
public
:
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
};
BaseExporter
Definition
BaseFactory.h:88
BaseFactory
Definition
BaseFactory.h:94
IParsedData
Definition
BaseFactory.h:80
VtxBinaryExporter
Definition
VtxFactory.h:23
VtxCodeExporter
Definition
VtxFactory.h:27
VtxFactory
Definition
VtxFactory.h:31
VtxHeaderExporter
Definition
VtxFactory.h:19
VtxRaw
Definition
VtxFactory.h:5
src
factories
VtxFactory.h
Generated by
1.14.0