]> icculus.org git repositories - divverent/darkplaces.git/blob - model_zymotic.h
Fix for exit segfault preventing fullscreen cleanup, and for the segfault as well.
[divverent/darkplaces.git] / model_zymotic.h
1 typedef struct zymlump_s
2 {
3         int start;
4         int length;
5 } zymlump_t;
6
7 typedef struct zymtype1header_s
8 {
9         char id[12]; // "ZYMOTICMODEL", length 12, no termination
10         int type; // 0 (vertex morph) 1 (skeletal pose) or 2 (skeletal scripted)
11         int filesize; // size of entire model file
12         float mins[3], maxs[3], radius; // for clipping uses
13         int numverts;
14         int numtris;
15         int numshaders;
16         int numbones; // this may be zero in the vertex morph format (undecided)
17         int numscenes; // 0 in skeletal scripted models
18
19 // skeletal pose header
20         // lump offsets are relative to the file
21         zymlump_t lump_scenes; // zymscene_t scene[numscenes]; // name and other information for each scene (see zymscene struct)
22         zymlump_t lump_poses; // float pose[numposes][numbones][6]; // animation data
23         zymlump_t lump_bones; // zymbone_t bone[numbones];
24         zymlump_t lump_vertbonecounts; // int vertbonecounts[numvertices]; // how many bones influence each vertex (separate mainly to make this compress better)
25         zymlump_t lump_verts; // zymvertex_t vert[numvertices]; // see vertex struct
26         zymlump_t lump_texcoords; // float texcoords[numvertices][2];
27         zymlump_t lump_render; // int renderlist[rendersize]; // sorted by shader with run lengths (int shader, count), each run can be used with glDrawElements (each triangle is 3 int indices)
28         zymlump_t lump_shaders; // char shadername[numshaders][32]; // shaders used on this model
29         zymlump_t lump_trizone; // byte trizone[numtris]; // see trizone explanation
30 }
31 zymtype1header_t;
32
33 #define ZYMBONEFLAG_SHARED 1
34
35 typedef struct zymbone_s
36 {
37         char name[32];
38         int flags;
39         int parent; // parent bone number
40 }
41 zymbone_t;
42
43 // normally the scene will loop, if this is set it will stay on the final frame
44 #define ZYMSCENEFLAG_NOLOOP 1
45
46 typedef struct zymscene_s
47 {
48         char name[32];
49         float mins[3], maxs[3], radius; // for clipping
50         float framerate; // the scene will animate at this framerate (in frames per second)
51         int flags;
52         int start, length; // range of poses
53 }
54 zymscene_t;
55
56 typedef struct zymvertex_s
57 {
58         int bonenum;
59         float origin[3];
60 }
61 zymvertex_t;