-
Notifications
You must be signed in to change notification settings - Fork 7
/
fmod.bt
179 lines (159 loc) · 5.58 KB
/
fmod.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
//------------------------------------------------
//--- 010 Editor v8.0.1 Binary Template
//
// File:
// Authors: Originally MHVuze (iirc) & AsteriskAmpersand, maintained by Silvris
// Version:
// Purpose:
// Category:
// File Mask:
// ID Bytes:
// History:
//------------------------------------------------
local int type;
local int count;
local int size;
local string sType;
typedef struct {
uint blockType;
uint blockCount;
uint blockSize;
} BlockHeader;
typedef struct{
uint material;
}uintData;
typedef struct{
float x;
float y;
float z;
}Vertex;
typedef struct{
float u;
float v;
}uv;
typedef struct{
uint unkn1;
uint unkn2;
uint blockSize;
float unkn3[3];
float unkn6;
float unkn7[3];
float float4[4];
uint unkn8;
float unkn9;
uint textureCount;
if (textureCount > 1){
byte unkn[200];
uint TextureLinkDif;
uint TextureLinkNor;
uint TextureLinkSpe;
}
else if (textureCount > 0){
byte unkn[200];
uint TextureLinkDif;
}
else {
byte unkn[200];
}
}MaterialBlock;
typedef struct{
uint Header1;
uint Header2;
uint blockSize;
uint imageID;
uint width;
uint height;
byte unkn[244];
}TextureBlock;
typedef struct{
float x;
float y;
float z;
}vect3;
typedef struct{
float x;
float y;
float z;
float w;
}vect4;
typedef struct{
uint32 Count;
//Printf("Tristrip Count: %d\n",Count);
uint32 vertexID[Count&0xFFFFFFF];
}tristrip;
typedef struct{
uint32 Data;
}InitBlock;
typedef struct{
byte datum;
}UnknData;
typedef struct{
uint32 material;
}uintList;
typedef struct{
int32 nodeID;
int32 parentID;
int32 leftChild;
int32 rightSibling;
uint32 unkn[8];
float vec[3];
float unknF;
uint32 unkn2[12*4];
}bone;
typedef struct{
uint boneID;
}boneList;
typedef struct{
uint32 boneID;
float weight;
}weightPair;
typedef struct{
int32 weightCount;
weightPair weightPairs[weightCount];
}weightBlock;
typedef struct{
short unkn1;
short unkn2;
uint unkn3;
uint null0;
uint unkn4;
uint null1;
uint unkn5;
uint nulls[2];
uint unkn6;
uint null2;
uint null3;
uint unkn7;
uint unkn8;
uint nulls2[5];
}VisconBlock;
struct ParseableBlock;
struct ParseableBlock{
BlockHeader Header;
Printf("%08x - %d\n",Header.blockType,Header.blockCount);
local int i;
if (Header.blockType == 0x020000)for(i=0;i<Header.blockCount;i++) InitBlock initBlock<optimize = false, bgcolor=0xFFFFFF>;//White
else if (Header.blockType == 1)for(i=0;i<Header.blockCount;i++) ParseableBlock fileBlock<optimize = false, bgcolor=0xFBF949>;//LightYellow
else if (Header.blockType == 2)for(i=0;i<Header.blockCount;i++) ParseableBlock mainBlock<optimize = false, bgcolor=0xD9C327>;//DarkYellow
else if (Header.blockType == 4)for(i=0;i<Header.blockCount;i++) ParseableBlock objBlock<optimize = false,bgcolor=0xB38601>;//Gold
else if (Header.blockType == 5)for(i=0;i<Header.blockCount;i++) ParseableBlock faceBlock<optimize = false,bgcolor=0x14B4D2>;//FaceBlock
else if (Header.blockType == 0xc0000000)for(i=0;i<Header.blockCount;i++) ParseableBlock skltBlock<optimize = false,bgcolor=0xFFB4D2>;//SkeletonBlock
else if (Header.blockType == 0)for(i=0;i<Header.blockCount;i++) uint SkeletonStart<optimize=false, bgcolor=0xD2B4FF>;//where skeletons start within bones
else if (Header.blockType == 0x40000001)for(i=0;i<Header.blockCount;i++) bone boneBlock<optimize = false,bgcolor=0x14B4FF>;
else if (Header.blockType == 0x30000)for(i=0;i<Header.blockCount;i++) tristrip Strips<optimize = false,bgcolor=0xFF2626>;//Red
else if (Header.blockType == 0x40000)for(i=0;i<Header.blockCount;i++) tristrip Strips2<optimize = false,bgcolor=0xFF5C26>;//Orange
else if (Header.blockType == 0x50000)for(i=0;i<Header.blockCount;i++) uintList MaterialList<optimize = false,bgcolor=0xDDDDDD>;//Grey
else if (Header.blockType == 0x60000)for(i=0;i<Header.blockCount;i++) uintData MaterialMap<optimize = false,bgcolor=0x777777>;//DarkGrey
else if (Header.blockType == 0x70000)for(i=0;i<Header.blockCount;i++) Vertex Vertices<optimize = false,bgcolor=0x273A59>;//Blue
else if (Header.blockType == 0x80000)for(i=0;i<Header.blockCount;i++) vect3 Normals<optimize = false,bgcolor=0x00BFFF>;//LightBlue
else if (Header.blockType == 0xA0000)for(i=0;i<Header.blockCount;i++) uv UVMapping<optimize = false,bgcolor=0xBF00FF>;//Purple
else if (Header.blockType == 0xB0000)for(i=0;i<Header.blockCount;i++) vect4 RGBA<optimize = false,bgcolor=0x2DB200>;//Green
else if (Header.blockType == 0xC0000)for(i=0;i<Header.blockCount;i++) weightBlock Weights<optimize = false,bgcolor=0x2DB240>;//Green?
else if (Header.blockType == 0x100000)for(i=0;i<Header.blockCount;i++) boneList Bones<optimize = false,bgcolor=0x7B7EB6>;//Faded Orange
else if (Header.blockType == 0x120000)for(i=0;i<Header.blockCount;i++) vect4 unknFloats<optimize = false,bgcolor=0x9BB67B>;//Faded Green
else if (Header.blockType == 0xF0000)for(i=0;i<Header.blockCount;i++) VisconBlock Viscons<optimize = false, bgcolor=0x993366>;
else if (Header.blockType == 9)for(i=0;i<Header.blockCount;i++) MaterialBlock Material<optimize = false, bgcolor=0xB57EDC>;//Lavender
else if (Header.blockType == 10)for(i=0;i<Header.blockCount;i++) TextureBlock TextureLink<optimize = false, bgcolor=0xB6967B>;//Blue-Gray
else for(i=0;i<(Header.blockSize-12);i++)UnknData Data<optimize = false,bgcolor=0x000000, name="unkBlock">; // sType
};
ParseableBlock MainBlock;