#pragma once /* Vector */ typedef float vec3_t[3]; /* MDL header */ typedef struct { int ident; /* magic number: "IDPO" */ int version; /* version: 6 */ vec3_t scale; /* scale factor */ vec3_t translate; /* translation vector */ float boundingradius; vec3_t eyeposition; /* eyes' position */ int num_skins; /* number of textures */ int skinwidth; /* texture width */ int skinheight; /* texture height */ int num_verts; /* number of vertices */ int num_tris; /* number of triangles */ int num_frames; /* number of frames */ int synctype; /* 0 = synchron, 1 = random */ int flags; /* state flag */ float size; } mdl_header_t; /* Skin */ typedef struct { int group; /* 0 = single, 1 = group */ unsigned char* data; /* texture data */ } mdl_skin_t; /* Group of pictures */ typedef struct { int group; /* 1 = group */ int nb; /* number of pics */ float* time; /* time duration for each pic */ unsigned char** data; /* texture data */ } mdl_groupskin_t; /* Texture coords */ typedef struct { int onseam; int s; int t; } mdl_texcoord_t; /* Triangle info */ typedef struct { int facesfront; /* 0 = backface, 1 = frontface */ int vertex[3]; /* vertex indices */ } mdl_triangle_t; /* Compressed vertex */ typedef struct { unsigned char v[3]; unsigned char normalIndex; } mdl_vertex_t; /* Simple frame */ typedef struct { mdl_vertex_t bboxmin; /* bouding box min */ mdl_vertex_t bboxmax; /* bouding box max */ char name[16]; mdl_vertex_t* verts; /* vertex list of the frame */ } mdl_simpleframe_t; /* Model frame */ typedef struct { int type; /* 0 = simple, !0 = group */ mdl_simpleframe_t frame; /* this program can't read models composed of group frames! */ } mdl_frame_t; /* Group of simple frames */ typedef struct { int type; /* !0 = group */ mdl_vertex_t min; /* min pos in all simple frames */ mdl_vertex_t max; /* max pos in all simple frames */ float* time; /* time duration for each frame */ mdl_simpleframe_t* frames; /* simple frame list */ } mdl_groupframe_t;