-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimationFile.h
47 lines (41 loc) · 1.19 KB
/
AnimationFile.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
#pragma once
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <cstdint>
#include "ninja.h"
class AnimationFile
{
public:
AnimationFile(const char *filename);
AnimationFile(const wchar_t *filename);
AnimationFile(const std::string &filename);
AnimationFile(const std::wstring &filename);
AnimationFile(std::istream &stream);
NJS_MOTION *getmotion() const;
int getmodelcount() const;
bool isshortrot() const;
const std::string &getlabel();
const std::string& getlabel(void* data);
void* getdata(const std::string& label);
const std::unordered_map<std::string, void*>* getlabels() const;
private:
static const uint64_t SAANIM = 0x4D494E414153u;
static const uint64_t FormatMask = 0xFFFFFFFFFFFFu;
static const uint8_t CurrentVersion = 2;
static const int headersize = 0x14;
NJS_MOTION *motion;
int modelcount;
bool shortrot;
std::unordered_map<void*, std::string> labels1;
std::unordered_map<std::string, void*> labels2;
std::vector<std::shared_ptr<void>> allocatedmem;
std::unordered_set<void *> fixedpointers;
enum ChunkTypes : uint32_t
{
ChunkTypes_Label = 0x4C42414C,
ChunkTypes_End = 0x444E45
};
void init(std::istream &stream);
};