This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
helpers.h
69 lines (62 loc) · 1.81 KB
/
helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <iostream>
#include <string>
#include <filesystem>
#include <vector>
#include <unordered_map>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <stdint.h>
#include <filesystem>
#include <stdio.h>
#include <string>
#include <functional>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include "package.h"
#include <cmath>
#include "dxgiformat.h"
std::string getReferenceFromHash(std::string hash, std::string pkgsPath);
std::string getHash64(uint64_t hash64, std::unordered_map<uint64_t, uint32_t> hash64Table);
std::string getPkgID(std::string hash);
uint16_t getPkgID(uint32_t hash);
std::string uint16ToHexStr(uint16_t num);
std::string uint32ToHexStr(uint32_t num);
uint16_t swapUInt16Endianness(uint16_t x);
uint32_t swapUInt32Endianness(uint32_t x);
uint64_t swapUInt64Endianness(uint64_t x);
uint32_t hexStrToUint16(std::string hash);
uint32_t hexStrToUint32(std::string hash);
uint64_t hexStrToUint64(std::string hash);
//std::string getReferenceFromHash(std::string hash);
std::string getPkgID(std::string hash);
uint16_t getPkgID(uint32_t hash);
std::string getFileFromHash(std::string hsh);
std::string load3(const std::string& path);
void filePutContents(const std::string& name, const std::string& content);
std::string to_str(double a_value);
struct LODSplit
{
uint32_t off;
uint32_t count;
};
class Submesh
{
private:
public:
std::vector<std::vector<float>> vertPos;
std::vector<std::vector<float>> vertNorm;
std::vector<std::vector<float>> vertUV;
std::vector<std::vector<float>> vertCol;
std::vector<std::vector<int16_t>> faces;
std::vector<std::vector<uint32_t>> facesu32;
std::vector<uint16_t> vertNormW;
std::vector<std::vector<float>> vertColSlots;
int lodLevel;
std::string name;
bool isU32;
int type;
std::vector<LODSplit> lodsplit;
};