FS2_Open
Open source remastering of the Freespace 2 engine
modelsinc.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 #ifndef _MODELSINC_H
11 #define _MODELSINC_H
12 
13 
14 class polymodel;
15 
16 #ifndef MODEL_LIB
17 #error This should only be used internally by the model library. See John if you think you need to include this elsewhere.
18 #endif
19 
20 #define OP_EOF 0
21 #define OP_DEFPOINTS 1
22 #define OP_FLATPOLY 2
23 #define OP_TMAPPOLY 3
24 #define OP_SORTNORM 4
25 #define OP_BOUNDBOX 5
26 
27 // change header for freespace2
28 //#define FREESPACE1_FORMAT
29 #define FREESPACE2_FORMAT
30 #if defined( FREESPACE1_FORMAT )
31 #elif defined ( FREESPACE2_FORMAT )
32 #else
33  #error Neither FREESPACE1_FORMAT or FREESPACE2_FORMAT defined
34 #endif
35 
36 // endianess will be handled by cfile and others now, little-endian should be default in all cases
37 
38 // little-endian (Intel) IDs
39 #define POF_HEADER_ID 0x4f505350 // 'OPSP' (PSPO) POF file header
40 #if defined( FREESPACE1_FORMAT )
41  // FREESPACE1 FORMAT
42  #define ID_OHDR 0x5244484f // RDHO (OHDR): POF file header
43  #define ID_SOBJ 0x4a424f53 // JBOS (SOBJ): Subobject header
44 #else
45  #define ID_OHDR 0x32524448 // 2RDH (HDR2): POF file header
46  #define ID_SOBJ 0x324a424f // 2JBO (OBJ2): Subobject header
47 #endif
48 #define ID_TXTR 0x52545854 // RTXT (TXTR): Texture filename list
49 #define ID_INFO 0x464e4950 // FNIP (PINF): POF file information, like command line, etc
50 #define ID_GRID 0x44495247 // DIRG (GRID): Grid information
51 #define ID_SPCL 0x4c435053 // LCPS (SPCL): Special object -- like a gun, missile, docking point, etc.
52 #define ID_PATH 0x48544150 // HTAP (PATH): A spline based path
53 #define ID_GPNT 0x544e5047 // TNPG (GPNT): gun points
54 #define ID_MPNT 0x544e504d // TNPM (MPNT): missile points
55 #define ID_DOCK 0x4b434f44 // KCOD (DOCK): docking points
56 #define ID_TGUN 0x4e554754 // NUGT (TGUN): turret gun points
57 #define ID_TMIS 0x53494d54 // SIMT (TMIS): turret missile points
58 #define ID_FUEL 0x4c455546 // LEUF (FUEL): thruster points
59 #define ID_SHLD 0x444c4853 // DLHS (SHLD): shield definition
60 #define ID_EYE 0x20455945 // EYE (EYE ): eye information
61 #define ID_INSG 0x47534e49 // GSNI (INSG): insignia information
62 #define ID_ACEN 0x4e454341 // NECA (ACEN): autocentering information
63 #define ID_GLOW 0x574f4c47 // WOLG (GLOW): glow points -Bobboau
64 #define ID_GLOX 0x584f4c47 // experimental glow points will be gone as soon as we get a proper pof editor -Bobboau
65 #define ID_SLDC 0x43444c53 // CDLS (SLDC): Shield Collision Tree
66 
67 #define uw(p) (*((uint *) (p)))
68 #define w(p) (*((int *) (p)))
69 #define wp(p) ((int *) (p))
70 #define vp(p) ((vec3d *) (p))
71 #define fl(p) (*((float *) (p)))
72 
73 extern int model_interp(matrix * orient, ubyte * data, polymodel * pm );
74 
75 // Creates the octants for a given polygon model
77 
78 // frees the memory the octants use for a given polygon model
80 
81 void model_calc_bound_box( vec3d *box, vec3d *big_mn, vec3d *big_mx);
82 
84 
85 // endian swapping stuff - tigital
86 void swap_bsp_data( polymodel *pm, void *model_ptr );
87 
88 // endian swapping stuff - kaz
90 
91 extern vec3d **Interp_verts;
92 
93 #endif
void model_octant_free(polymodel *pm)
int model_interp(matrix *orient, ubyte *data, polymodel *pm)
Definition: pstypes.h:88
void interp_clear_instance()
hull_check orient
Definition: lua.cpp:5049
void swap_sldc_data(ubyte *buffer)
Definition: modelread.cpp:5471
GLuint buffer
Definition: Glext.h:5492
unsigned char ubyte
Definition: pstypes.h:62
void swap_bsp_data(polymodel *pm, void *model_ptr)
Definition: modelread.cpp:5415
void model_calc_bound_box(vec3d *box, vec3d *big_mn, vec3d *big_mx)
Definition: modelread.cpp:1009
GLenum GLsizei GLenum GLenum const GLvoid * data
Definition: Gl.h:1509
void model_octant_create(polymodel *pm)
vec3d ** Interp_verts
polymodel * pm
Definition: lua.cpp:1598