This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
BTAB.bt
76 lines (65 loc) · 2.32 KB
/
BTAB.bt
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
70
71
72
73
74
75
76
//------------------------------------------------
//--- 010 Editor v11.0.1 Binary Template
//
// File: BTAB.bt
// Authors: TKGP
// Version:
// Purpose: Lightmap atlasing config files introduced in DS2
// Category: Dantelion
// File Mask: *.btab
// ID Bytes:
// History:
//------------------------------------------------
#include "Util.bt"
if (ReadByte(0x10))
BigEndian();
else
LittleEndian();
local int VARINT_LONG <hidden=true> = ReadInt(0x14) == 0x28;
//------------------------------------------------
typedef struct {
int unk00; Assert(unk00 == 1);
int unk04 <hidden=true>; Assert(unk04 == 0);
int entryCount;
int stringsLength <format=hex>;
byte bigEndian; Assert(bigEndian == 0 || bigEndian == 1);
byte unk11 <hidden=true>; Assert(unk11 == 0);
byte unk12 <hidden=true>; Assert(unk12 == 0);
byte unk13 <hidden=true>; Assert(unk13 == 0);
int entrySize <format=hex>; Assert(entrySize == 0x1C || entrySize == 0x28);
int unk18 <hidden=true>; Assert(unk18 == 0);
int unk1C <hidden=true>; Assert(unk1C == 0);
int unk20 <hidden=true>; Assert(unk20 == 0);
int unk24 <hidden=true>; Assert(unk24 == 0);
int unk28 <hidden=true>; Assert(unk28 == 0);
int unk2C <hidden=true>; Assert(unk2C == 0);
int unk30 <hidden=true>; Assert(unk30 == 0);
int unk34 <hidden=true>; Assert(unk34 == 0);
int unk38 <hidden=true>; Assert(unk38 == 0);
} Header <bgcolor=cLtRed>;
typedef struct {
Varint msbPartNameOffset;
Varint flverMaterialNameOffset;
int atlasID;
Vector2 uvOffset;
Vector2 uvScale;
if (VARINT_LONG) {
int pad1C <hidden=true>; Assert(pad1C == 0);
}
local quad pos <hidden=true> = FTell();
FSeek(stringsStart + msbPartNameOffset.val);
wstring msbPartName <bgcolor=cLtGreen>;
FSeek(stringsStart + flverMaterialNameOffset.val);
wstring flverMaterialName <bgcolor=cLtGreen>;
FSeek(pos);
} Entry <read=ReadEntry, bgcolor=cAqua, optimize=false>;
wstring ReadEntry(Entry& entry) {
string str;
SPrintf(str, "%3i | ", entry.atlasID);
return str + entry.msbPartName + " : " + entry.flverMaterialName;
}
//------------------------------------------------
Header header;
local quad stringsStart <hidden=true> = FTell();
FSkip(header.stringsLength);
struct { Entry entries[header.entryCount]; } entries <open=true>;