-
Notifications
You must be signed in to change notification settings - Fork 4
/
TTMFile.h
54 lines (39 loc) · 1.03 KB
/
TTMFile.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
#ifndef TTMFILE_H
#define TTMFILE_H
#include "CompressedBaseFile.h"
#include <map>
#include <set>
namespace SCRANTIC {
class TTMFile : public CompressedBaseFile
{
private:
std::map<u16, std::string> mnemonics;
int getParamCount(u16 opcode);
u16 getOpcodeFromMnemonic(std::string &mnemonic);
u16 countUpdateInScript();
void parseRawScript();
void initMnemonics();
std::string getMnemoic(Command c);
protected:
u32 verSize;
std::string version;
u32 pagSize; // always 2 ?
u16 pag;
u16 fullTagSize;
u16 magic; // 0x8000
u32 tagSize;
u16 tagCount;
std::map<u16, std::string> tagList;
v8 rawScript;
std::map<u16, std::vector<Command> > script;
public:
TTMFile(const std::string &name, v8 &data);
explicit TTMFile(const std::string &filename);
std::vector<Command> getFullScene(u16 num);
std::string getTag(u16 num);
bool hasInit();
void saveFile(const std::string &path) override;
v8 repackIntoResource() override;
};
}
#endif // TTMFILE_H