Home | History | Annotate | Download | only in client
      1 /*
      2 Copyright (C) 1996-1997 Id Software, Inc.
      3 
      4 This program is free software; you can redistribute it and/or
      5 modify it under the terms of the GNU General Public License
      6 as published by the Free Software Foundation; either version 2
      7 of the License, or (at your option) any later version.
      8 
      9 This program is distributed in the hope that it will be useful,
     10 but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     12 
     13 See the GNU General Public License for more details.
     14 
     15 You should have received a copy of the GNU General Public License
     16 along with this program; if not, write to the Free Software
     17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     18 
     19 */
     20 //
     21 // modelgen.h: header file for model generation program
     22 //
     23 
     24 // *********************************************************
     25 // * This file must be identical in the modelgen directory *
     26 // * and in the Quake directory, because it's used to      *
     27 // * pass data from one to the other via model files.      *
     28 // *********************************************************
     29 
     30 #ifdef INCLUDELIBS
     31 
     32 #include <stdlib.h>
     33 #include <stdio.h>
     34 #include <math.h>
     35 #include <string.h>
     36 
     37 #include "cmdlib.h"
     38 #include "scriplib.h"
     39 #include "trilib.h"
     40 #include "lbmlib.h"
     41 #include "mathlib.h"
     42 
     43 #endif
     44 
     45 #define ALIAS_VERSION	6
     46 
     47 #define ALIAS_ONSEAM				0x0020
     48 
     49 // must match definition in spritegn.h
     50 #ifndef SYNCTYPE_T
     51 #define SYNCTYPE_T
     52 typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
     53 #endif
     54 
     55 typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t;
     56 
     57 typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t;
     58 
     59 typedef struct {
     60 	int			ident;
     61 	int			version;
     62 	vec3_t		scale;
     63 	vec3_t		scale_origin;
     64 	float		boundingradius;
     65 	vec3_t		eyeposition;
     66 	int			numskins;
     67 	int			skinwidth;
     68 	int			skinheight;
     69 	int			numverts;
     70 	int			numtris;
     71 	int			numframes;
     72 	synctype_t	synctype;
     73 	int			flags;
     74 	float		size;
     75 } mdl_t;
     76 
     77 // TODO: could be shorts
     78 
     79 typedef struct {
     80 	int		onseam;
     81 	int		s;
     82 	int		t;
     83 } stvert_t;
     84 
     85 typedef struct dtriangle_s {
     86 	int					facesfront;
     87 	int					vertindex[3];
     88 } dtriangle_t;
     89 
     90 #define DT_FACES_FRONT				0x0010
     91 
     92 // This mirrors trivert_t in trilib.h, is present so Quake knows how to
     93 // load this data
     94 
     95 typedef struct {
     96 	byte	v[3];
     97 	byte	lightnormalindex;
     98 } trivertx_t;
     99 
    100 typedef struct {
    101 	trivertx_t	bboxmin;	// lightnormal isn't used
    102 	trivertx_t	bboxmax;	// lightnormal isn't used
    103 	char		name[16];	// frame name from grabbing
    104 } daliasframe_t;
    105 
    106 typedef struct {
    107 	int			numframes;
    108 	trivertx_t	bboxmin;	// lightnormal isn't used
    109 	trivertx_t	bboxmax;	// lightnormal isn't used
    110 } daliasgroup_t;
    111 
    112 typedef struct {
    113 	int			numskins;
    114 } daliasskingroup_t;
    115 
    116 typedef struct {
    117 	float	interval;
    118 } daliasinterval_t;
    119 
    120 typedef struct {
    121 	float	interval;
    122 } daliasskininterval_t;
    123 
    124 typedef struct {
    125 	aliasframetype_t	type;
    126 } daliasframetype_t;
    127 
    128 typedef struct {
    129 	aliasskintype_t	type;
    130 } daliasskintype_t;
    131 
    132 #define IDPOLYHEADER	(('O'<<24)+('P'<<16)+('D'<<8)+'I')
    133 														// little-endian "IDPO"
    134 
    135