Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
gd_types.h
Go to the documentation of this file.
1 #ifndef GD_TYPES_H
2 #define GD_TYPES_H
3 
4 #include <ultra64.h>
5 
6 /* Vector Types */
7 struct GdVec3f
8 {
9  f32 x, y, z;
10 };
11 
12 struct GdPlaneF {
13  struct GdVec3f p0, p1;
14 };
15 
16 struct GdTriangleF {
17  struct GdVec3f p0, p1, p2;
18 };
19 
20 typedef f32 Mat4f[4][4];
21 
22 struct GdColour {
23  f32 r, g, b;
24 };
25 
26 /* dynlist entries and types */
27 union DynUnion {
28  void *ptr;
29  char *str;
31 };
32 
33 struct DynList {
35  union DynUnion w1;
36  union DynUnion w2;
37  struct GdVec3f vec;
38 };
39 
40 /* Goddard Code Object Structs */
41 /* Object Type Flags */
43  OBJ_TYPE_GROUPS = 0x00000001,
44  OBJ_TYPE_BONES = 0x00000002,
45  OBJ_TYPE_JOINTS = 0x00000004,
46  OBJ_TYPE_PARTICLES = 0x00000008,
47  OBJ_TYPE_SHAPES = 0x00000010,
48  OBJ_TYPE_NETS = 0x00000020,
49  OBJ_TYPE_PLANES = 0x00000040,
50  OBJ_TYPE_FACES = 0x00000080,
51  OBJ_TYPE_VERTICES = 0x00000100,
52  OBJ_TYPE_CAMERAS = 0x00000200,
53  // 0x400 was not used
54  OBJ_TYPE_MATERIALS = 0x00000800,
55  OBJ_TYPE_WEIGHTS = 0x00001000,
56  OBJ_TYPE_GADGETS = 0x00002000,
57  OBJ_TYPE_VIEWS = 0x00004000,
58  OBJ_TYPE_LABELS = 0x00008000,
59  OBJ_TYPE_ANIMATORS = 0x00010000,
60  OBJ_TYPE_VALPTRS = 0x00020000,
61  // 0x40000 was not used
62  OBJ_TYPE_LIGHTS = 0x00080000,
63  OBJ_TYPE_ZONES = 0x00100000,
64  OBJ_TYPE_UNK200000 = 0x00200000
65 };
66 /* This constant seems to be used to indicate the type of any or all objects */
67 #define OBJ_TYPE_ALL 0x00FFFFFF
68 
69 
71 typedef void (*drawmethod_t)(void *);
76  OBJ_PICKED = 0x04,
77  OBJ_IS_GRABBALE = 0x08,
79 };
80 
87 struct GdObj {
88  /* 0x00 */ struct GdObj *prev;
89  /* 0x04 */ struct GdObj *next;
90  /* 0x08 */ drawmethod_t objDrawFn;
91  /* 0x0C */ enum ObjTypeFlag type;
92  /* 0x10 */ s16 number;
93  /* 0x12 */ u16 drawFlags;
94  /* 0x14 Specific object data starts here */
95 };
96 
97 /* Used to create a linked list of objects (or data)
98 ** within an ObjGroup */
99 struct Links {
100  /* 0x00 */ struct Links *prev;
101  /* 0x04 */ struct Links *next;
102  /* 0x08 */ struct GdObj *obj;
103 };
104 
105 /* These are the compressed versions of ObjFace or ObjVertex that are
106 ** pointed to by Links in the faceGroup and vtxGroup, if Group.linkType
107 ** is set to 0x01. See `chk_shapegen` */
108 struct GdFaceData {
111  u16 (*data)[4];
112 };
113 
114 struct GdVtxData {
117  s16 (*data)[3];
118 };
119 
120 
124 struct ObjGroup {
125  /* 0x00 */ struct GdObj header;
126  /* 0x14 */ struct ObjGroup *prev;
127  /* 0x18 */ struct ObjGroup *next;
128  /* 0x1C */ struct Links *link1C;
129  /* 0x20 */ struct Links *link20; // what is this second one used for?
130  /* 0x24 */ s32 groupObjTypes;
131  /* 0x28 */ s32 objCount;
132  /* 0x2C */ s32 debugPrint; // might also be a type?
133  /* 0x30 */ s32 linkType;
134  /* 0x34 */ char name[0x40];
135  /* 0x74 */ s32 id;
136 }; /* sizeof = 0x78 */
137 
138 /* Known linkTypes
139  * 0x00 : Normal (link to GdObj)
140  * 0x01 : Compressed (vtx or face data)
141  */
142 
143 struct ObjBone {
144  /* 0x000 */ struct GdObj header;
145  /* 0x014 */ struct GdVec3f unk14; // "position"?? from dead code in draw_bone
146  /* 0x020 */ struct ObjBone *prev; // maybe, based on make_bone
147  /* 0x024 */ struct ObjBone *next; // maybe, based on make_bone
148  /* 0x028 */ struct GdVec3f unk28; // "rotation"?? from dead code in draw_bone
149  /* 0x034 */ u8 pad34[0x40-0x34];
150  /* 0x040 */ struct GdVec3f unk40;
151  /* 0x04C */ u8 pad4C[0x58-0x4C];
152  /* 0x058 */ struct GdVec3f unk58;
153  /* 0x064 */ struct GdVec3f unk64;
154  /* 0x070 */ Mat4f mat70;
155  /* 0x0B0 */ Mat4f matB0;
156  /* 0x0F0 */ struct ObjShape *unkF0; // from dead code in draw_bone
157  /* 0x0F4 */ f32 unkF4;
158  /* 0x0F8 */ f32 unkF8; // from dead code in draw_bone
159  /* 0x0FC */ f32 unkFC;
160  /* 0x100 */ s32 unk100; // "colour"
161  /* 0x104 */ s32 unk104; // "flags"
162  /* 0x108 */ s32 id;
163  /* 0x10C */ struct ObjGroup *unk10C; // group of joints?
164  /* 0x110 */ f32 unk110; // "spring"
165  /* 0x114 */ f32 unk114;
166  /* 0x118 */ f32 unk118;
167  /* 0x11C */ u8 pad11C[0x124-0x11C];
168 }; /* sizeof = 0x124 */
169 
170 struct ObjJoint {
171  /* 0x000 */ struct GdObj header;
172  /* 0x014 */ struct GdVec3f unk14; //position? based on d_set_initpos
173  /* 0x020 */ struct ObjShape *unk20;
174  /* 0x024 */ struct ObjJoint *prevjoint; // prev joint? linked joint?
175  /* 0x028 */ struct ObjJoint *nextjoint;
176  /* 0x02C */ void (*fn2C)(struct ObjJoint*);
177  /* 0x030 */ struct GdVec3f unk30; // huge array of vecs? another matrix?
178  /* 0x03C */ struct GdVec3f unk3C; // relative position?
179  /* 0x048 */ struct GdVec3f unk48;
180  /* 0x054 */ struct GdVec3f unk54; // attached offset (with +200 as well)
181  /* 0x060 */ u8 pad60[0x6C-0x60];
182  /* 0x06C */ struct GdVec3f unk6C; // initial rotation vec
183  /* 0x078 */ struct GdVec3f unk78;
184  /* 0x084 */ struct GdVec3f unk84;
185  /* 0x090 */ struct GdVec3f unk90;
186  /* 0x09C */ struct GdVec3f unk9C; // scale vec?
187  /* 0x0A8 */ struct GdVec3f unkA8;
188  /* 0x0B4 */ struct GdVec3f unkB4;
189  /* 0x0C0 */ struct GdVec3f unkC0; // "shape offset"
190  /* 0x0CC */ struct GdVec3f unkCC;
191  /* 0x0D8 */ u8 padD8[4];
192  /* 0x0DC */ struct GdVec3f unkDC; // "friction"
193  /* 0x0E8 */ Mat4f matE8; //matrix4x4
194  /* 0x128 */ Mat4f mat128; // "rot matrix"
195  /* 0x168 */ Mat4f mat168; // "id matrix"
196  /* 0x1A8 */ struct GdVec3f unk1A8;
197  /* 0x1B4 */ s32 id;
198  /* 0x1B8 */ u8 pad1B8[4];
199  /* 0x1BC */ s32 unk1BC; // "flags"
200  /* 0x1C0 */ s32 unk1C0;
201  /* 0x1C4 */ struct ObjGroup *unk1C4; // bone group?
202  /* 0x1C8 */ s32 unk1C8; // "colour"
203  /* 0x1CC */ s32 unk1CC; // "type"
204  /* 0x1D0 */ struct ObjAnimator *unk1D0;
205  /* 0x1D4 */ u8 pad1D4[0x1f4-0x1d4];
206  /* 0x1F4 */ struct ObjGroup *unk1F4; //Group of ObjWeights, only? skin weights?
207  /* 0x1F8 */ struct ObjGroup *unk1F8; //attach object group
208  /* 0x1FC */ s32 unk1FC; //d_attach_to arg 0; "AttFlag"
209  /* 0x200 */ struct GdVec3f unk200; //attached offset?
210  /* 0x20C */ struct GdObj *unk20C; //attached object?
211  /* 0x210 */ u8 pad210[0x228-0x210];
212  /* 0x228 */ f32 unk228;
213 }; /* sizeof = 0x22C */
214 
215 /* Particle Types (+60)
216  3 = Has groups of other particles in 6C?
217 */
218 
219 struct ObjParticle {
220  /* 0x00 */ struct GdObj header;
221  /* 0x14 */ u8 pad14[0x1C-0x14];
222  /* 0x1C */ struct ObjShape *unk1C; // looks like a shape...
223  /* 0x20 */ struct GdVec3f unk20; // position vec?
224  /* 0x2C */ u8 pad2C[0x30-0x2C];
225  /* 0x30 */ f32 unk30;
226  /* 0x34 */ u8 pad34[0x38-0x34];
227  /* 0x38 */ struct GdVec3f unk38;
228  /* 0x44 */ f32 unk44; //not vec?
229  /* 0x48 */ f32 unk48; //not vec?
230  /* 0x4C */ u8 pad4C[0x50-0x4C];
231  /* 0x50 */ s32 id;
232  /* 0x54 */ u32 unk54; // "dflags"?
233  /* 0x58 */ s32 unk58; // "colour"
234  /* 0x5C */ s32 unk5C; // gd dl dlptr offset?
235  /* 0x60 */ s32 unk60; //flag? type?
236  /* 0x64 */ s32 unk64; //flag?
237  /* 0x68 */ u8 pad68[0x6C-0x68];
238  /* 0x6C */ struct ObjGroup *unk6C; // group of other Particles ?
239  /* 0x70 */ u8 pad70[4];
240  /* 0x74 */ s32 unk74;
241  /* 0x78 */ u8 unk78[4];
242  /* 0x7C */ struct ObjAnimator *unk7C; // guessing on type; doesn't seem to be used in final code
243  /* 0x80 */ struct ObjLight *unk80; // could be a Net or Light; not seen as non-null in running code
244  /* 0x84 */ u8 pad84[0xB0-0x84];
245  /* 0xB0 */ s32 unkB0; //state?
246  /* 0xB4 */ struct ObjGroup *unkB4; // attach group? unused group of particles
247  /* 0xB8 */ s32 unkB8; //attached arg0; "AttFlag"
248  /* 0xBC */ struct GdObj *unkBC; //attached obj? looks like can be a Light or Camera
249 }; /* sizeof = 0xC0 */
250 
251 struct ObjShape {
252  /* 0x00 */ struct GdObj header;
253  /* 0x14 */ struct ObjShape *prevShape;
254  /* 0x18 */ struct ObjShape *nextShape;
255  /* 0x1C */ struct ObjGroup *faceGroup; /* face group; based on get_3DG1_shape */
256  /* 0x20 */ struct ObjGroup *vtxGroup; /* vtx group; based on get_3DG1_shape */
257  /* 0x24 */ struct ObjGroup *unk24; /* group for type 2 shapenets only ? */
258  /* 0x28 */ u8 pad28[4];
259  /* 0x2C */ struct ObjGroup *mtlGroup; /* what does this group do? materials? */
260  /* 0x30 */ s32 unk30;
261  /* 0x34 */ s32 faceCount; /* face count? based on get_3DG1_shape */
262  /* 0x38 */ s32 vtxCount; /* vtx count? based on get_3DG1_shape */
263  /* 0x3C */ s32 unk3C; // bool? if FALSE, then draw_shape_faces(shape)
264  /* 0x40 */ u32 id;
265  /* 0x44 */ s32 flag; // what are the flag values? only from dynlists?
266  /* 0x48 */ s32 gdDls[3]; // gd dl number for each frame buffer (??) [0, 1]; and an offset for GdDl->dlptr [2]
267  /* 0x54 */ u8 pad54[0x58-0x54]; // part of above array??
268  /* 0x58 */ f32 unk58; // paramF? opacitiy? something with rendertype
269  /* 0x5C */ char name[0x40];
270 }; /* sizeof = 0x9C */
271 
272 /* 0x44 Flag Values
273  * 0x01 -
274  * 0x10 - Use vtx position as vtx normal? (`chk_shapegen`)
275  */
276 
277 /* netTypes
278  * 0 - default?
279  * 1 - shape net
280  * 2 - something about the shape unk24 group having vertices too?
281  * 3 - joints?
282  * 4 - dynamic net? bone net?
283  * 5 - particle net?
284  * 6 - stub
285  * 7 -
286  */
287 
288 struct ObjNet {
289  /* 0x000 */ struct GdObj header;
290  /* 0x014 */ struct GdVec3f unk14; // position? d_set_initpos + d_set_world_pos; print_net says world
291  /* 0x020 */ struct GdVec3f unk20; // position? d_set_initpos? attached offset? dynamic? scratch?
292  /* 0x02C */ u8 pad2c[0x34-0x2C];
293  /* 0x034 */ s32 unk34; // "dflags"?
294  /* 0x038 */ u32 unk38; // some sort of id? from move_net
295  /* 0x03C */ s32 unk3C; // state flags? vertex info flags?
296  /* 0x040 */ s32 unk40; // gd "colour"
297  /* 0x044 */ struct GdVec3f unk44; // "force"
298  /* 0x050 */ struct GdVec3f unk50; // velocity
299  /* 0x05C */ struct GdVec3f unk5C; // rotation
300  /* 0x068 */ struct GdVec3f unk68; //initial rotation?
301  /* 0x074 */ struct GdVec3f unk74; // "collDisp"
302  /* 0x080 */ struct GdVec3f unk80; // "collTorque"
303  /* 0x08C */ struct GdVec3f unk8C; // "CollTorqueL"
304  /* 0x098 */ struct GdVec3f unk98; // "CollTorqueD"
305  /* 0x0A4 */ struct GdVec3f unkA4; // torque
306  /* 0x0B0 */ struct GdVec3f unkB0; // "CofG" center of gravity?
307  /* 0x0BC */ struct GdPlaneF unkBC; // bounding box
308  /* 0x0D4 */ struct GdVec3f unkD4; // "CollDispOff"
309  /* 0x0E0 */ f32 unkE0; // "CollMaxD"
310  /* 0x0E4 */ f32 unkE4; // "MaxRadius"
311  /* 0x0E8 */ Mat4f matE8;
312  /* 0x128 */ Mat4f mat128;
313  /* 0x168 */ Mat4f mat168; // "rotation matrix"
314  /* 0x1A8 */ struct ObjShape *unk1A8; // "ShapePtr"
315  /* 0x1AC */ struct GdVec3f unk1AC; // scale
316  /* 0x1B8 */ f32 unk1B8; // "Mass"
317  /* 0x1BC */ s32 unk1BC; // "NumModes"
318  /* 0x1C0 */ struct ObjGroup *unk1C0;
319  /* 0x1C4 */ struct ObjGroup *skinGrp; // SkinGroup (from reset_weight) (joints and bones)
320  /* 0x1C8 */ struct ObjGroup *unk1C8; // "node group" (joints, weights?)
321  /* 0x1CC */ struct ObjGroup *unk1CC; // plane group (only type 1?)
322  /* 0x1D0 */ struct ObjGroup *unk1D0; // vertex group
323  /* 0x1D4 */ struct ObjGroup *unk1D4; // attached objects group?
324  /* 0x1D8 */ struct GdVec3f unk1D8; // attached offset
325  /* 0x1E4 */ s32 unk1E4; // d_attach_to arg 0; "AttFlag"
326  /* 0x1E8 */ struct GdObj *unk1E8; // attached obj?
327  /* 0x1EC */ s32 netType; // from move_net
328  /* 0x1F0 */ struct ObjNet *unk1F0; // or joint. guess from Unknown80192AD0
329  /* 0x1F4 */ struct GdVec3f unk1F4;
330  /* 0x200 */ struct GdVec3f unk200;
331  /* 0x20C */ struct ObjGroup *unk20C;
332  /* 0x210 */ s32 unk210; // "control type"
333  /* 0x214 */ u8 pad214[0x21C-0x214];
334  /* 0x21C */ struct ObjGroup *unk21C;
335 }; /* sizeof = 0x220 */
336 
337 struct ObjPlane {
338  /* 0x00 */ struct GdObj header;
339  /* 0x14 */ u32 id;
340  /* 0x18 */ s32 unk18; //bool; contained within zone? (from its parent Net?)
341  /* 0x1C */ f32 unk1C;
342  /* 0x20 */ s32 unk20;
343  /* 0x24 */ s32 unk24;
344  /* 0x28 */ struct GdPlaneF plane28; //position plane?
345  /* 0x40 */ struct ObjFace* unk40;
346 }; /* sizeof = 0x44*/
347 
348 struct ObjVertex {
349  /* 0x00 */ struct GdObj header;
350  /* 0x14 */ struct GdVec3f initPos;
351  /* 0x20 */ struct GdVec3f pos; // rel position? world pos? both are set with the same value..
352  /* 0x2C */ struct GdVec3f normal; // normal? also color (like gbi?)
353  /* 0x38 */ s16 id;
354  /* 0x3A */ u8 pad3A[2];
355  /* 0x3C */ f32 unk3C;
356  /* 0x40 */ f32 alpha;
357  /* 0x44 */ struct VtxLink *gbiVerts;
358 }; /* sizeof = 0x48 */
359 
360 struct VtxLink {
361  struct VtxLink *prev;
362  struct VtxLink *next;
364 };
365 
366 struct ObjFace {
367  /* 0x00 */ struct GdObj header;
368  /* 0x14 */ struct GdColour colour;
369  /* 0x20 */ s32 colNum; // "colour" index
370  /* 0x24 */ struct GdVec3f normal;
371  /* 0x30 */ s32 vtxCount;
372  /* 0x34 */ struct ObjVertex *vertices[4]; // these can also be s32 indices? which are then replaced by `find_thisface_verts`
373  /* 0x44 */ s32 mtlId; // from compressed GdFaceData; -1 == coloured face?
374  /* 0x48 */ struct ObjMaterial *mtl; // initialize to NULL; set by `map_face_materials` from mtlId
375 }; /* sizeof = 0x4C */
376 
377 struct ObjCamera {
378  /* 0x000 */ struct GdObj header;
379  /* 0x014 */ struct GdVec3f unk14; // position vec? from d_set_initpos
380  /* 0x020 */ struct ObjCamera* prev;
381  /* 0x024 */ struct ObjCamera* next;
382  /* 0x028 */ s32 id;
383  /* 0x02C */ s32 unk2C; // flag of some sort
384  /* 0x030 */ struct GdObj* unk30; // pointer to some type of object
385  /* 0x034 */ struct GdVec3f unk34;
386  /* 0x040 */ struct GdVec3f unk40; // relative position related?
387  /* 0x04C */ struct GdVec3f unk4C;
388  /* 0x058 */ f32 unk58; // GdVec3f ?
389  /* 0x05C */ u8 pad5C[0x4];
390  /* 0x060 */ f32 unk60;
391  /* 0x064 */ Mat4f unk64; //matrix4x4
392  /* 0x0A4 */ f32 unkA4;
393  /* 0x0A8 */ Mat4f unkA8; //matrix4x4
394  /* 0x0E8 */ Mat4f unkE8;
395  /* 0x128 */ struct GdVec3f unk128; //possibly
396  /* 0x134 */ struct GdVec3f unk134;
397  /* 0x140 */ struct GdVec3f positions[4]; // zoom positions (*1, *1.5, *2, empty fourth)
398  /* 0x170 */ s32 zoomLevels; // max number of zoom positions
399  /* 0x174 */ s32 zoom; // index into position vec array
400  /* 0x178 */ f32 unk178;
401  /* 0x17C */ f32 unk17C;
402  /* 0x180 */ struct GdVec3f unk180;
403  /* 0x18C */ struct ObjView *unk18C; // view that has/is using this camera?
404 }; /* sizeof = 0x190 */
405 
406 // These might not be types, but rather flags?
411 };
412 
413 struct ObjMaterial {
414  /* 0x00 */ struct GdObj header;
415  /* 0x14 */ u8 pad14[0x1c-0x14];
416  /* 0x1C */ s32 id;
417  /* 0x20 */ char name[8];
418  /* 0x28 */ s32 type;
419  /* 0x2C */ u8 pad2C[4];
420  /* 0x30 */ struct GdColour Ka; // ambient color
421  /* 0x3C */ struct GdColour Kd; // diffuse color
422  /* 0x48 */ u8 pad48[0x58-0x48];
423  /* 0x58 */ void *texture; //set by d_usetexture; never seems to be non-null though.
424  /* 0x5C */ s32 gddlNumber;
425 }; /* sizeof = 0x60 */
426 
427 struct ObjWeight {
428  /* 0x00 */ struct GdObj header;
429  /* 0x14 */ u8 pad14[0x8];
430  /* 0x1C */ s32 id; //id
431  /* 0x20 */ struct GdVec3f vec20; //based on func_80181894? maybe a GdPlaneF?
432  /* 0x2C */ u8 pad2C[0x38-0x2c];
433  /* 0x38 */ f32 unk38; // weight (unit?)
434  /* 0x3C */ struct ObjVertex* unk3C;
435 }; /* sizeof = 0x40 */
436 
437 /* This union is used in ObjGadget for a variable typed field.
438 ** The type can be found by checking group unk4C */
439 union ObjVarVal {
443 };
444 
445 struct ObjGadget {
446  /* 0x00 */ struct GdObj header;
447  /* 0x14 */ struct GdVec3f unk14; // "world" position vec?
448  /* 0x20 */ s32 unk20;
449  /* 0x24 */ s32 unk24; // type?
450  /* 0x28 */ f32 unk28;
451  /* 0x2C */ u8 pad2C[4];
452  /* 0x30 */ union ObjVarVal varval; //retype and rename varval30
453  /* 0x38 */ f32 unk38; //range left?
454  /* 0x3C */ f32 unk3C; //range right?
455  /* 0x40 */ struct GdVec3f unk40; // scale?
456  /* 0x4C */ struct ObjGroup *unk4C; //gfroup->link->obj = valptr for var30 ?
457  /* 0x50 */ struct ObjShape *unk50;
458  /* 0x54 */ struct ObjGroup *unk54; //node group?
459  /* 0x58 */ u8 pad58[4];
460  /* 0x5C */ s32 unk5C; // gd colour id (enum eventually)
461 }; /* sizeof = 0x60 */
462 
464  VIEW_2_COL_BUF = 0x000008,
465  VIEW_ALLOC_ZBUF = 0x000010,
468  VIEW_BORDERED = 0x000400,
469  VIEW_UPDATE = 0x000800,
470  VIEW_UNK_1000 = 0x001000, // used in setup_view_buffers
471  VIEW_UNK_2000 = 0x002000, // only see together with 0x4000
472  VIEW_UNK_4000 = 0x004000,
473  VIEW_COLOUR_BUF = 0x008000,
474  VIEW_Z_BUF = 0x010000,
475  VIEW_1_CYCLE = 0x020000,
476  VIEW_MOVEMENT = 0x040000,
477  VIEW_DRAW = 0x080000,
478  VIEW_WAS_UPDATED = 0x100000,
479  VIEW_LIGHT = 0x200000
480 };
481 
482 struct ObjView {
483  /* 0x00 */ struct GdObj header;
484  /* 0x14 */ u8 pad14[0x8];
485  /* 0x1C */ s32 unk1C; // set as nonexistent return of `setup_view_buffers`
486  /* 0x20 */ s32 id;
487  /* 0x24 */ struct ObjCamera *activeCam; // is this really active?
488  /* 0x28 */ struct ObjGroup *components; // camera + joints + nets, etc..?
489  /* 0x2C */ struct ObjGroup *lights; // only lights?
490  /* 0x30 */ struct GdObj *pickedObj; // selected with cursor (`update_view`)
491  /* 0x34 */ enum GdViewFlags flags;
492  /* 0x38 */ s32 unk38; // enum? if 1 use guPerspective (see `drawscene`)
493  /* 0x3C */ struct GdVec3f upperLeft; // position vec?
494  /* 0x48 */ f32 unk48; // what are these? are they another vec?
495  /* 0x4C */ f32 unk4C;
496  /* 0x50 */ u8 pad50[0x4];
497  /* 0x54 */ struct GdVec3f lowerRight;
498  /* 0x60 */ struct GdVec3f clipping; // z-coordinate of (x: near, y: far) clipping plane?
499  /* 0x6C */ const char *namePtr;
500  /* 0x70 */ s32 gdDlNum; // gd dl number
501  /* 0x74 */ s32 unk74;
502  /* 0x78 */ s32 unk78;
503  /* 0x7C */ struct GdColour colour;
504  /* 0x88 */ struct ObjView *parent; // maybe not a true parent, but link to buffers in parent?
505  /* 0x8C */ void *zbuf;
506  /* 0x90 */ void *colourBufs[2]; // frame buffers?
507  /* 0x98 */ void (*proc)(struct ObjView *); // Never non-null in game...?
508  /* 0x9C */ s32 unk9C;
509 }; /* sizeof = 0xA0 */
510 
511 
512 typedef union ObjVarVal * (*valptrproc_t)(union ObjVarVal *, union ObjVarVal);
513 
514 struct ObjLabel {
515  /* 0x00 */ struct GdObj header;
516  /* 0x14 */ struct GdVec3f vec14;
517  /* 0x20 */ char *fmtstr;
518  /* 0x24 */ s32 unk24;
519  /* 0x28 */ struct ObjValPtrs *valptr;
520  /* 0x2C */ valptrproc_t valfn;
521  /* 0x30 */ s32 unk30; // state or type?
522 }; /* sizeof = 0x34 */
523 
524 /* unk30 types:
525  * 3 = f32? f32 pointer?
526 **/
527 
528 struct ObjAnimator {
529  /* 0x00 */ struct GdObj header;
530  /* 0x14 */ struct ObjGroup* unk14; // joint?
531  /* 0x18 */ struct ObjGroup* animdata; //animation data? a group, but the link points to something weird..
532  /* 0x1C */ u8 pad1C[0x4];
533  /* 0x20 */ s32 unk20;
534  /* 0x24 */ f32 unk24;
535  /* 0x28 */ f32 unk28;
536  /* 0x2C */ u8 pad2C[4];
537  /* 0x30 */ struct ObjGroup* unk30; //attached group?
538  /* 0x34 */ s32 unk34; //attach arg0
539  /* 0x38 */ u8 pad38[0x44-0x38];
540  /* 0x44 */ struct GdObj* unk44; //attached object? Normally another Objanimator?
541  /* 0x48 */ void (*fn48) (struct ObjAnimator*);
542  /* 0x4C */ s32 unk4C; //state enum?
543  /* 0x50 */ s32 unk50;
544  /* 0x54 */ s32 unk54;
545 }; /* sizeof = 0x58 */
546 
547 /* Animation Data Types */
549  GD_ANIM_EMPTY = 0, // Listed types are how the data are arranged in memory; maybe not be exact type
550  GD_ANIM_MATRIX = 1, // f32[4][4]
551  GD_ANIM_TRI_F_2 = 2, // f32[3][3]
552  GD_ANIM_9H = 3, // s16[9]
553  GD_ANIM_TRI_F_4 = 4, // f32[3][3]
555  GD_ANIM_3H_SCALED = 6, // s16[3]
556  GD_ANIM_3H = 7, // s16[3]
557  GD_ANIM_6H_SCALED = 8, // s16[6]
558  GD_ANIM_MTX_VEC = 9, // {f32 mtx[4][4]; f32 vec[3];}
559  GD_ANIM_CAMERA = 11 // s16[6]
560 };
561 /* This struct is pointed to by the `obj` field in Links struct in the `animdata` ObjGroup */
562 struct AnimDataInfo {
563  s32 count; // count or -1 for end of array of AnimDataInfo structures
564  enum GdAnimations type; // types are used in "move_animator"
565  void* data; // points to an array of `type` data
566 };
567 /* GD_ANIM_MTX_VEC (9) type */
568 struct AnimMtxVec {
569  /* 0x00 */ Mat4f matrix;
570  /* 0x40 */ struct GdVec3f vec; // seems to be a scale vec
571 };
572 
576 };
577 
578 struct ObjValPtrs {
579  /* 0x00 */ struct GdObj header;
580  /* 0x14 */ struct GdObj *obj; // maybe just a void *?
581  /* 0x18 */ s32 offset;
582  /* 0x1C */ enum ValPtrType datatype;
583  /* 0x20 */ s32 unk20; // obj type ptr enum? Might be OBJ_TYPES flags?
584 }; /* sizeof = 0x24 */
585 
587  LIGHT_UNK02 = 0x02, // old type of light?
589  LIGHT_UNK20 = 0x20 // new, actually used type of light? used for phong shading?
590 };
591 
592 struct ObjLight {
593  /* 0x00 */ struct GdObj header;
594  /* 0x14 */ u8 pad0[0x8];
595  /* 0x1C */ s32 id;
596  /* 0x20 */ char name[8];
597  /* 0x28 */ u8 pad28[4];
598  /* 0x2C */ s32 flags;
599  /* 0x30 */ f32 unk30; // color (5C) = Kd (50) * 30
600  /* 0x34 */ u8 pad34[4];
601  /* 0x38 */ f32 unk38; // calculated diffuse theta (in degrees?)
602  /* 0x3C */ s32 unk3C;
603  /* 0x40 */ s32 unk40;
604  /* 0x44 */ u8 pad3[0x8];
605  /* 0x4C */ s32 unk4C;
606  /* 0x50 */ struct GdColour diffuse;
607  /* 0x5C */ struct GdColour colour;
608  /* 0x68 */ struct GdVec3f unk68;
609  /* 0x74 */ struct GdVec3f position;
610  /* 0x80 */ struct GdVec3f unk80;
611  /* 0x8C */ struct GdVec3f unk8C;
612  /* 0x98 */ s32 unk98;
613  /* 0x9C */ struct ObjShape *unk9C;
614 }; /* sizeof = 0xA0 */
615 
616 struct ObjZone {
617  /* 0x00 */ struct GdObj header;
618  /* 0x14 */ struct GdPlaneF unk14;
619  /* 0x2C */ struct ObjGroup *unk2C; // plane group?
620  /* 0x30 */ struct ObjGroup *unk30; // guess based on Unknown801781DC; might have to change later
621  /* 0x34 */ u8 pad[4];
622 }; /* sizeof = 0x38*/
623 
624 struct ObjUnk200000 {
625  /* 0x00 */ struct GdObj header;
626  /* 0x14 */ u8 pad14[0x30-0x14];
627  /* 0x30 */ struct ObjVertex *unk30; //not sure; guessing for Unknown801781DC; 30 and 34 could switch with ObjZone
628  /* 0x34 */ struct ObjFace *unk34; //not sure; guessing for Unknown801781DC
629 }; /* sizeof = 0x38*/
630 
631 #endif /* GD_TYPES_H */
f32 unk30
Definition: gd_types.h:225
struct ObjGroup * unkB4
Definition: gd_types.h:246
struct GdObj * unk44
Definition: gd_types.h:540
only bitfields can omit the member name(10) useless keyword or type name in declaration Type was ignored. '%s' declared within and is limited to this function prototype Possible program error
f32 unk17C
Definition: gd_types.h:401
s32 flags
Definition: gd_types.h:598
struct GdObj * prev
Definition: gd_types.h:88
Definition: gd_types.h:108
s32 unk210
Definition: gd_types.h:332
Definition: gd_types.h:337
Mat4f mat168
Definition: gd_types.h:313
s32 unk34
Definition: gd_types.h:538
Definition: gd_types.h:482
Definition: gd_types.h:467
struct ObjGroup * unk1C4
Definition: gd_types.h:201
Definition: gd_types.h:574
Definition: gd_types.h:427
Definition: gd_types.h:33
struct ObjGroup * animdata
Definition: gd_types.h:531
s32 id
Definition: gd_types.h:231
Definition: gd_types.h:12
Definition: gd_types.h:47
s32 unk38
Definition: gd_types.h:492
Mat4f unk64
Definition: gd_types.h:391
s32 id
Definition: gd_types.h:162
Mat4f unkE8
Definition: gd_types.h:394
u32 unk38
Definition: gd_types.h:294
struct ObjGroup * mtlGroup
Definition: gd_types.h:259
struct GdObj * next
Definition: gd_types.h:89
struct GdObj * unk20C
Definition: gd_types.h:210
unsigned short int u16
Definition: ultratypes.h:14
Out of while attempting to print an unavailable message The error message file is inaccessible or has other problems Unknown Signal s An unknown signal has been caught Nested signals line but accepted as written The constant is too large to fit in a bit data type
Definition: err.english.cc:364
s32 offset
Definition: gd_types.h:581
s32 unk3C
Definition: gd_types.h:295
struct GdObj * unk1E8
Definition: gd_types.h:326
s32 unk30
Definition: gd_types.h:521
s32 unkB0
Definition: gd_types.h:245
Definition: gd_types.h:348
struct ObjShape * unkF0
Definition: gd_types.h:156
f32 unkFC
Definition: gd_types.h:159
Definition: gd_types.h:471
struct ObjGroup * unk4C
Definition: gd_types.h:456
Definition: gd_types.h:588
s32 word
Definition: gd_types.h:30
Definition: gd_types.h:78
struct GdObj * unkBC
Definition: gd_types.h:248
f32 unk58
Definition: gd_types.h:388
f32 unk38
Definition: gd_types.h:601
Definition: gd_types.h:472
signed short int s16
Definition: ultratypes.h:13
Definition: gd_types.h:46
Definition: gd_types.h:55
s32 unk18
Definition: gd_types.h:340
s32 unk4C
Definition: gd_types.h:605
Mat4f mat168
Definition: gd_types.h:195
Mat4f matB0
Definition: gd_types.h:155
void(* fn2C)(struct ObjJoint *)
Definition: gd_types.h:176
struct ObjAnimator * unk1D0
Definition: gd_types.h:204
Mat4f unkA8
Definition: gd_types.h:393
Definition: gd_types.h:575
s32 unk20
Definition: gd_types.h:533
Definition: gd_types.h:251
struct ObjVertex * unk3C
Definition: gd_types.h:434
Definition: gd_types.h:288
f32 unkE0
Definition: gd_types.h:309
s32 count
Definition: gd_types.h:563
union ObjVarVal *(* valptrproc_t)(union ObjVarVal *, union ObjVarVal)
Definition: gd_types.h:512
Definition: gd_types.h:549
s32 vtxCount
Definition: gd_types.h:262
Definition: gd_types.h:54
Definition: gd_types.h:578
GdLightFlags
Definition: gd_types.h:586
Definition: gd_types.h:473
s32 unk20
Definition: gd_types.h:342
Definition: gd_types.h:58
struct ObjGroup * unk1D0
Definition: gd_types.h:322
struct ObjGroup * unk2C
Definition: gd_types.h:619
struct ObjGroup * skinGrp
Definition: gd_types.h:319
s32 unk40
Definition: gd_types.h:296
struct ObjGroup * unk14
Definition: gd_types.h:530
Definition: gd_types.h:22
Mat4f matrix
Definition: gd_types.h:569
f32 unk48
Definition: gd_types.h:229
u32 id
Definition: gd_types.h:339
s16 number
the index of this GdObj in the linked list
Definition: gd_types.h:92
s32 unk58
Definition: gd_types.h:233
unsigned long long int u64
Definition: ultratypes.h:18
f32 unk58
Definition: gd_types.h:268
f32 unk1B8
Definition: gd_types.h:316
s32 unk1FC
Definition: gd_types.h:208
f32 unk44
Definition: gd_types.h:228
f32 unk48
Definition: gd_types.h:494
s32 gddlNumber
Definition: gd_types.h:424
Definition: gd_types.h:587
s32 unk104
Definition: gd_types.h:161
f32 unk118
Definition: gd_types.h:166
void * zbuf
Definition: gd_types.h:505
Definition: gd_types.h:468
s32 unk1CC
Definition: gd_types.h:203
Definition: gd_types.h:439
f32 unkA4
Definition: gd_types.h:392
s32 zoomLevels
Definition: gd_types.h:398
Definition: gd_types.h:475
s32 unk1BC
Definition: gd_types.h:199
u32 id
Definition: gd_types.h:264
Definition: gd_types.h:62
Definition: gd_types.h:60
Definition: gd_types.h:44
f32 unk28
Definition: gd_types.h:450
s32 unk3C
Definition: gd_types.h:602
Definition: gd_types.h:556
Definition: gd_types.h:52
s32 netType
Definition: gd_types.h:327
f32 unk24
Definition: gd_types.h:534
struct Links * link20
Definition: gd_types.h:129
void * texture
Definition: gd_types.h:423
f32 unk60
Definition: gd_types.h:390
Definition: gd_types.h:51
struct ObjGroup * unk1F4
Definition: gd_types.h:206
s32 unk78
Definition: gd_types.h:502
s32 flag
Definition: gd_types.h:265
f32 unk114
Definition: gd_types.h:165
s32 unk98
Definition: gd_types.h:612
Definition: gd_types.h:477
float f32
Definition: ultratypes.h:29
f32 r
Definition: gd_types.h:23
Definition: gd_types.h:552
void * ptr
Definition: gd_types.h:28
data
Definition: seq_decoder.py:292
s32 id
Definition: gd_types.h:135
f32 unkF8
Definition: gd_types.h:158
s32 unk64
Definition: gd_types.h:236
Definition: gd_types.h:469
s32 unk100
Definition: gd_types.h:160
Definition: gd_types.h:409
s32 colNum
Definition: gd_types.h:369
f32 unk38
Definition: gd_types.h:433
s32 zoom
Definition: gd_types.h:399
GdMtlTypes
Definition: gd_types.h:407
s32 type
Definition: gd_types.h:110
struct GdObj * obj
Definition: gd_types.h:580
struct ObjShape * unk50
Definition: gd_types.h:457
s32 faceCount
Definition: gd_types.h:261
struct ObjFace * unk40
Definition: gd_types.h:345
struct ObjGroup * components
Definition: gd_types.h:488
struct ObjShape * unk1A8
Definition: gd_types.h:314
f32 unk38
Definition: gd_types.h:453
Definition: gd_types.h:466
drawmethod_t objDrawFn
Definition: gd_types.h:90
Mat4f mat128
Definition: gd_types.h:312
struct ObjView * unk18C
Definition: gd_types.h:403
Definition: gd_types.h:568
Definition: gd_types.h:377
Definition: gd_types.h:410
f32 f
Definition: gd_types.h:441
The base of structure of all of Goddard&#39;s objects.
Definition: gd_types.h:87
s32 objCount
Definition: gd_types.h:131
u32 count
Definition: gd_types.h:115
This GdObj can be grabbed/picked by the cursor.
Definition: gd_types.h:77
s32 unk4C
Definition: gd_types.h:542
Mat4f mat128
Definition: gd_types.h:194
f32 y
Definition: gd_types.h:9
struct ObjGroup * lights
Definition: gd_types.h:489
Definition: gd_types.h:470
Definition: gd_types.h:74
u16 drawFlags
enumerated in ObjDrawingFlags
Definition: gd_types.h:93
struct ObjGroup * prev
Definition: gd_types.h:126
struct ObjGroup * unk1C8
Definition: gd_types.h:320
struct ObjGroup * vtxGroup
Definition: gd_types.h:256
struct ObjJoint * nextjoint
Definition: gd_types.h:175
f32 unk110
Definition: gd_types.h:164
struct ObjGroup * unk1CC
Definition: gd_types.h:321
struct Links * link1C
Head of a linked list for objects contained in this group.
Definition: gd_types.h:128
s32 mtlId
Definition: gd_types.h:373
s32 unk9C
Definition: gd_types.h:508
Definition: gd_types.h:476
Definition: gd_types.h:413
f32 unkE4
Definition: gd_types.h:310
Definition: gd_types.h:50
struct ObjCamera * next
Definition: gd_types.h:381
struct ObjCamera * prev
Definition: gd_types.h:380
Definition: gd_types.h:366
Definition: gbi_old.h:25
Definition: gd_types.h:114
struct ObjNet * unk1F0
Definition: gd_types.h:328
This GdObj is held by the cursor.
Definition: gd_types.h:76
struct ObjGroup * next
Definition: gd_types.h:127
struct ObjJoint * prevjoint
Definition: gd_types.h:174
s32 cmd
Definition: gd_types.h:34
Definition: gd_types.h:479
struct ObjBone * prev
Definition: gd_types.h:146
struct ObjGroup * unk54
Definition: gd_types.h:458
struct ObjGroup * faceGroup
Definition: gd_types.h:255
Definition: gd_types.h:16
s32 unk5C
Definition: gd_types.h:234
Definition: gd_types.h:592
s32 unk34
Definition: gd_types.h:293
struct ObjAnimator * unk7C
Definition: gd_types.h:242
struct ObjGroup * unk10C
Definition: gd_types.h:163
f32 unk3C
Definition: gd_types.h:355
Definition: gd_types.h:170
s32 unk40
Definition: gd_types.h:603
s32 id
Definition: gd_types.h:430
Definition: gd_types.h:408
s32 gdDlNum
Definition: gd_types.h:500
u64 l
Definition: gd_types.h:442
s32 unk54
Definition: gd_types.h:544
struct ObjView * parent
Definition: gd_types.h:504
ObjTypeFlag
Definition: gd_types.h:42
Definition: gd_types.h:616
Definition: gd_types.h:465
struct ObjShape * unk9C
Definition: gd_types.h:613
f32 unk178
Definition: gd_types.h:400
struct ObjLight * unk80
Definition: gd_types.h:243
void * data
Definition: gd_types.h:565
f32 unk228
Definition: gd_types.h:212
s32 unk74
Definition: gd_types.h:501
s32 unk5C
Definition: gd_types.h:460
s32 unk50
Definition: gd_types.h:543
s32 vtxCount
Definition: gd_types.h:371
struct ObjGroup * unk1C0
Definition: gd_types.h:318
Definition: gd_types.h:557
struct ObjGroup * unk30
Definition: gd_types.h:537
f32 unk4C
Definition: gd_types.h:495
Definition: gd_types.h:528
f32 alpha
Definition: gd_types.h:356
u32 unk54
Definition: gd_types.h:232
Definition: gd_types.h:56
This is test documentation comment for ObjGroup.
Definition: gd_types.h:124
Definition: gd_types.h:7
ObjDrawingFlags
Flags for the drawFlags field of an GdObj.
Definition: gd_types.h:73
struct ObjShape * prevShape
Definition: gd_types.h:253
Definition: gd_types.h:553
struct ObjGroup * unk24
Definition: gd_types.h:257
s32 unk1C8
Definition: gd_types.h:202
Mat4f matE8
Definition: gd_types.h:311
s32 debugPrint
Definition: gd_types.h:132
s32 id
Definition: gd_types.h:416
s32 unk20
Definition: gd_types.h:448
void * colourBufs[2]
Definition: gd_types.h:506
char * fmtstr
Definition: gd_types.h:517
s32 unk3C
Definition: gd_types.h:263
s32 unk1C
Definition: gd_types.h:485
struct ObjFace * unk34
Definition: gd_types.h:628
unsigned char u8
Definition: ultratypes.h:12
Definition: gd_types.h:624
Mat4f mat70
Definition: gd_types.h:154
struct ObjGroup * unk1F8
Definition: gd_types.h:207
Definition: gd_types.h:474
valptrproc_t valfn
Definition: gd_types.h:520
f32 unk28
Definition: gd_types.h:535
f32 unk30
Definition: gd_types.h:599
Definition: gd_types.h:558
s32 id
Definition: gd_types.h:197
struct VtxLink * gbiVerts
Definition: gd_types.h:357
struct ObjGroup * unk20C
Definition: gd_types.h:331
s32 linkType
Definition: gd_types.h:133
Definition: gd_types.h:589
void(* proc)(struct ObjView *)
Definition: gd_types.h:507
f32 z
Definition: gd_types.h:9
s32 unk60
Definition: gd_types.h:235
struct ObjMaterial * mtl
Definition: gd_types.h:374
s32 unk1E4
Definition: gd_types.h:325
struct ObjShape * unk1C
Definition: gd_types.h:222
s32 unk20
Definition: gd_types.h:583
struct ObjShape * nextShape
Definition: gd_types.h:254
const char * namePtr
Definition: gd_types.h:499
Definition: gd_types.h:49
s32 unk1BC
Definition: gd_types.h:317
signed int s32
Definition: ultratypes.h:15
f32 unkF4
Definition: gd_types.h:157
Definition: gd_types.h:478
s32 i
Definition: gd_types.h:440
f32 unk3C
Definition: gd_types.h:454
struct ObjGroup * unk1D4
Definition: gd_types.h:323
s32 unk30
Definition: gd_types.h:260
f32 unk1C
Definition: gd_types.h:341
struct GdObj * unk30
Definition: gd_types.h:384
Definition: gd_types.h:143
f32 Mat4f[4][4]
Definition: gd_types.h:20
s32 groupObjTypes
OR&#39;d collection of type flags for all objects in this group.
Definition: gd_types.h:130
s16 id
Definition: gd_types.h:353
Definition: gd_types.h:27
Definition: gd_types.h:514
Definition: gd_types.h:45
s32 id
Definition: gd_types.h:595
Definition: gd_types.h:554
struct ObjCamera * activeCam
Definition: gd_types.h:487
Definition: gd_types.h:445
s32 type
Definition: gd_types.h:116
Definition: gd_types.h:57
Definition: gd_types.h:559
struct ObjGroup * unk30
Definition: gd_types.h:620
ValPtrType
Definition: gd_types.h:573
This GdObj shouldn&#39;t be drawn when updating a scene.
Definition: gd_types.h:75
s32 id
Definition: gd_types.h:382
struct GdObj * pickedObj
Definition: gd_types.h:490
struct ObjVertex * unk30
Definition: gd_types.h:627
s32 unk24
Definition: gd_types.h:449
s32 type
Definition: gd_types.h:418
void(* drawmethod_t)(void *)
Function pointer for a GdObj&#39;s drawing routine.
Definition: gd_types.h:71
Definition: gd_types.h:48
one operand is a pointer to an object or incomplete type and the other is a pointer to a qualified or unqualified version of void
Definition: err.english.cc:848
Definition: gd_types.h:555
char * str
Definition: gd_types.h:29
Definition: gd_types.h:464
s32 id
Definition: gd_types.h:486
Definition: gd_types.h:43
s32 unk24
Definition: gd_types.h:343
Definition: gd_types.h:63
unsigned int u32
Definition: ultratypes.h:16
GdAnimations
Definition: gd_types.h:548
struct ObjValPtrs * valptr
Definition: gd_types.h:519
Definition: gd_types.h:219
struct ObjShape * unk20
Definition: gd_types.h:173
struct ObjGroup * unk21C
Definition: gd_types.h:334
s32 unk74
Definition: gd_types.h:240
s32 unk24
Definition: gd_types.h:518
Mat4f matE8
Definition: gd_types.h:193
Definition: gd_types.h:59
Definition: gd_types.h:550
Definition: gd_types.h:64
s32 unkB8
Definition: gd_types.h:247
struct ObjBone * next
Definition: gd_types.h:147
Definition: gd_types.h:562
Definition: gd_types.h:551
GdViewFlags
Definition: gd_types.h:463
s32 unk1C0
Definition: gd_types.h:200
s32 unk2C
Definition: gd_types.h:383
struct ObjGroup * unk6C
Definition: gd_types.h:238
u32 count
Definition: gd_types.h:109
f32 x
Definition: gd_types.h:9