flt2c.h
4.49 KB
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/*
* NOTICE: This source code includes data structures for the MultiGen Flight
* Format which is the proprietary property of MultiGen Inc. It is furnished
* here under a license to Silicon Graphics and Nintendo soley for use in this
* program. If you wish to use the Flight Format for any other purpose, a no
* charge license is noramlly available; contact MultiGen Inc. at
* 408-247-4326.
*/
/*
* These codes are stolen from Performer's loader:
*/
/*
* Multigen opcodes
*/
#define MG_HEADER 1
#define MG_GROUP 2
#define MG_LOD 3
#define MG_OBJECT 4
#define MG_POLYGON 5
#define MG_VERT_ABS 7
#define MG_VERT_SHAD 8
#define MG_VERT_NORM 9
#define MG_PUSH 10
#define MG_POP 11
#define MG_DOF 13
#define MG_DOFFLOAT 14
#define MG_PUSH_SF 19
#define MG_POP_SF 20
#define MG_COMMENT 31
#define MG_COLOR_TABLE 32
/* opcodes 40-48 are other transformation record types */
#define MG_MATRIX 49
#define MG_VECTOR 50
#define MG_BBOX 51
#define MG_REPLICATE 60
#define MG_INSTANCE_REF 61
#define MG_INSTANCE_DEF 62
#define MG_EXTERNAL_REF 63
#define MG_TEXTURE_REF 64
#define MG_EYEPOINTS 65
#define MG_MATERIAL_TABLE 66
#define MG_VTXTABLE 67
#define MG_DVERT_ABS 68
#define MG_DVERT_NORM 69
#define MG_DVERT_NORM_TEX 70
#define MG_DVERT_ABS_TEX 71
#define MG_VTXLIST 72
#define MG_LODFLOAT 73
/*typedef unsigned long ulong;
typedef unsigned short ushort;*/
typedef unsigned char uchar;
struct color {
ushort red;
ushort green;
ushort blue;
};
struct fcolor {
float red;
float green;
float blue;
};
struct material {
struct fcolor ambient;
struct fcolor diffuse;
struct fcolor specular;
struct fcolor emissive;
float shininess;
float alpha; /* 1 = opaque */
ulong flags;
int spare[31];
};
struct opBead {
ushort opcode;
ushort length;
};
struct opColor {
ushort opcode;
ushort length;
struct color brightest[32];
struct color fixed[56];
};
struct opVertexTable {
ushort opcode;
ushort length;
ulong lengthvert;
};
struct opVertex {
ushort opcode;
ushort length;
ushort color;
ushort flags;
double x;
double y;
double z;
};
struct opVertexN {
ushort opcode;
ushort length;
ushort color;
ushort flags;
double x;
double y;
double z;
float nx;
float ny;
float nz;
int unused;
};
struct opVertexUV {
ushort opcode;
ushort length;
ushort color;
ushort flags;
double x;
double y;
double z;
float u;
float v;
};
struct opVertexNUV {
ushort opcode;
ushort length;
ushort color;
ushort flags;
double x;
double y;
double z;
float nx;
float ny;
float nz;
float u;
float v;
int unused; /* unused in .flt, but used in flt2c to store
an alpha value */
int tx; /* texture X dimension */
int ty; /* texture Y dimension */
};
struct opVertexList {
ushort opcode;
ushort length;
ulong vertex[64];
};
struct opObject {
ushort opcode;
ushort oplength;
uchar id[8];
ulong flags;
ushort priority;
ushort transparency;
ushort effect1;
ushort effect2;
ushort significance;
ushort spare;
};
struct opGroup {
ushort opcode;
ushort oplength;
uchar id[8];
ushort priority;
ushort dummy; /* For alignment */
ulong flags;
ushort effect1;
ushort effect2;
ushort significance;
ushort spare;
};
struct opPolygon {
ushort opcode;
ushort oplength;
uchar id[8];
ulong IRcolor;
ushort priority;
uchar flags;
uchar texwhite;
ushort color1;
ushort color2;
uchar unused;
uchar transparency_flags;
ushort detail;
ushort texture;
ushort material;
ushort surface;
ushort feature;
ulong IRmaterial;
ushort transparency;
uchar LOD;
uchar spare;
};
struct opLODFloat {
ushort opcode;
ushort oplength;
uchar id[8];
ulong spare;
double switchin;
double switchout;
ushort effect1;
ushort effect2;
ulong flags;
double x;
double y;
double z;
double morph;
};
struct opTexture {
ushort opcode;
ushort oplength;
uchar name[80];
ulong index;
ulong x;
ulong y;
};
struct opComment {
ushort opcode;
ushort oplength;
uchar comment[1]; /* Variable */
};
struct opMaterial {
ushort opcode;
ushort oplength;
struct material mat[64];
};