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