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
/
BTL.bt
117 lines (106 loc) · 2.56 KB
/
BTL.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//------------------------------------------------
//--- 010 Editor v9.0.1 Binary Template
//
// File: BTL.bt
// Authors: TKGP
// Version:
// Purpose:
// Category:
// File Mask: *.btl
// ID Bytes:
// History:
//------------------------------------------------
LittleEndian();
#include "Util.bt"
// Note to self:
// Strings are padded to 0x10 /relative to the start of the string block/
// That's why there's all that garbage in there.
typedef struct {
int unk00; Assert(unk00 == 2);
int version;
int lightCount;
int namesLength <format=hex>;
int unk10; Assert(unk10 == 0);
int lightSize <format=hex>;
local int i <hidden=true>;
for (i = 0; i < 9; i++) {
int unk14 <hidden=true>; Assert(unk14 == 0);
}
} Header <bgcolor=cLtRed>;
typedef struct (int lightSize, quad namesStart) {
int unk00;
int unk04;
int unk08;
int unk0C;
if (lightSize == 0xC0) {
int nameOffset <format=hex>;
} else {
quad nameOffset <format=hex>;
}
int unk18;
byte unk1C;
byte diffuseRGB[3];
float diffusePower;
byte specularRGB[3];
byte unk27;
float specularPower;
float coneAngle;
float unk30;
float unk34;
Vector3 position;
Vector3 rotation;
int unk50;
float unk54;
float radius;
int unk5C;
int unk60; Assert(unk60 == 0);
byte unk64[4];
float unk68;
byte unk6C[4];
float unk70;
float unk74;
float unk78;
float unk7C;
int unk80;
byte unk84[4];
float unk88;
int unk8C; Assert(unk8C == 0);
float unk90;
int unk94; Assert(unk94 == 0);
float unk98;
float unk9C;
byte unkA0[4];
float unkA4;
int unkA8; Assert(unkA8 == 0);
float unkAC;
if (lightSize == 0xC0) {
int unkB0; Assert(unkB0 == 0);
} else {
quad unkB0; Assert(unkB0 == 0);
}
float width;
float unkBC;
byte unkC0[4];
float unkC4;
if (lightSize > 0xC8) {
float unkC8;
float unkCC;
float unkD0;
int unkD4; Assert(unkD4 == 0);
float unkD8;
int unkDC;
int unkE0; Assert(unkE0 == 0);
int unkE4; Assert(unkE4 == 0);
}
local quad pos <hidden=true> = FTell();
FSeek(namesStart + nameOffset);
wstring name <bgcolor=cLtGreen>;
FSeek(pos);
} Light <read=ReadLight, bgcolor=cAqua, optimize=false>;
wstring ReadLight(Light& light) {
return light.name;
}
Header header;
local quad namesStart <hidden=true> = FTell();
FSkip(header.namesLength);
Light lights(header.lightSize, namesStart)[header.lightCount];