]> icculus.org git repositories - taylor/freespace2.git/blob - include/modelsinc.h
Initial revision
[taylor/freespace2.git] / include / modelsinc.h
1 #ifndef _MODELSINC_H
2 #define _MODELSINC_H
3
4 #include "model.h"
5
6 #ifndef MODEL_LIB 
7 #error This should only be used internally by the model library.  See John if you think you need to include this elsewhere.
8 #endif
9
10 #define OP_EOF                  0
11 #define OP_DEFPOINTS    1
12 #define OP_FLATPOLY             2
13 #define OP_TMAPPOLY             3
14 #define OP_SORTNORM             4
15 #define OP_BOUNDBOX             5
16
17 // change header for freespace2
18 //#define FREESPACE1_FORMAT
19 #define FREESPACE2_FORMAT
20 #if defined( FREESPACE1_FORMAT )
21 #elif defined ( FREESPACE2_FORMAT )
22 #else
23         #error Neither FREESPACE1_FORMAT or FREESPACE2_FORMAT defined
24 #endif
25
26 // FREESPACE1 FORMAT
27 #if defined( FREESPACE1_FORMAT )
28         #define ID_OHDR 'RDHO'  // POF file header
29         #define ID_SOBJ 'JBOS'  // Subobject header
30 #else
31         #define ID_OHDR '2RDH'  // POF file header
32         #define ID_SOBJ '2JBO'  // Subobject header
33 #endif
34 #define ID_TXTR 'RTXT'  // Texture filename list
35 #define ID_INFO 'FNIP'  // POF file information, like command line, etc
36 #define ID_GRID 'DIRG'  // Grid information
37 #define ID_SPCL 'LCPS'  // Special object -- like a gun, missile, docking point, etc.
38 #define ID_PATH 'HTAP'  // A spline based path
39 #define ID_GPNT 'TNPG'  // gun points
40 #define ID_MPNT 'TNPM'  // missile points
41 #define ID_DOCK 'KCOD'  // docking points
42 #define ID_TGUN 'NUGT'  // turret gun points
43 #define ID_TMIS 'SIMT'  // turret missile points
44 #define ID_FUEL 'LEUF'  // thruster points
45 #define ID_SHLD 'DLHS'  // shield definition
46 #define ID_EYE  ' EYE'  // eye information
47 #define ID_INSG 'GSNI'  // insignia information
48 #define ID_ACEN 'NECA'  // autocentering information
49
50 #define uw(p)   (*((uint *) (p)))
51 #define w(p)    (*((int *) (p)))
52 #define wp(p)   ((int *) (p))
53 #define vp(p)   ((vector *) (p))
54 #define fl(p)   (*((float *) (p)))
55
56 extern int model_interp(matrix * orient, ubyte * data, polymodel * pm );
57
58 // Creates the octants for a given polygon model
59 void model_octant_create( polymodel * pm );
60
61 // frees the memory the octants use for a given polygon model
62 void model_octant_free( polymodel * pm );
63
64 void model_calc_bound_box( vector *box, vector *big_mn, vector *big_mx);
65
66 void interp_clear_instance();
67
68 #define MAX_POLYGON_VECS        1100            //6500 (7x)
69 #define MAX_POLYGON_NORMS       2800            //6500 (3x)
70
71 extern vector *Interp_verts[MAX_POLYGON_VECS];
72
73 #endif
74