]> icculus.org git repositories - taylor/freespace2.git/blob - include/trails.h
proper padding of PXO stats struct for FS2 demo
[taylor/freespace2.git] / include / trails.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 /*
10  * $Logfile: /Freespace2/code/Weapon/Trails.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * External defs for missile trail stuff
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:15  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
25  * 3     11/14/98 5:33p Dave
26  * Lots of nebula work. Put in ship contrails.
27  * 
28  * 2     10/07/98 10:54a Dave
29  * Initial checkin.
30  * 
31  * 1     10/07/98 10:51a Dave
32  * 
33  * 3     3/23/98 5:00p John
34  * Improved missile trails.  Made smooth alpha under hardware.  Made end
35  * taper.  Made trail touch weapon.
36  * 
37  * 2     12/21/97 6:15p John
38  * Made a seperate system for missile trails
39  * 
40  * 1     12/21/97 5:30p John
41  * Initial version
42  *
43  * $NoKeywords: $
44  */
45
46 #ifndef _TRAILS_H
47 #define _TRAILS_H
48
49 #include "pstypes.h"
50
51 #define NUM_TRAIL_SECTIONS 16
52
53 // contrail info - similar to that for missile trails
54 // place this inside of info structures instead of explicit structs (eg. ship_info instead of ship, or weapon_info instead of weapon)
55 typedef struct trail_info {
56         vector pt;                              // offset from the object's center
57         float w_start;                  // starting width
58         float w_end;                    // ending width
59         float a_start;                  // starting alpha
60         float a_end;                    // ending alpha
61         float max_life;         // max_life for a section
62         int stamp;                              // spew timestamp
63         int bitmap;                             // bitmap to use
64 } trail_info;
65
66 // Call at start of level to reinit all missilie trail stuff
67 void trail_level_init();
68
69 // Needs to be called from somewhere to move the trails each frame
70 void trail_move_all(float frametime);
71
72 // Needs to be called from somewhere to render the trails each frame
73 void trail_render_all();
74
75 // The following functions are what the weapon code calls
76 // to deal with trails:
77
78 // Returns -1 if failed
79 int trail_create(trail_info info);
80 void trail_add_segment( int trail_num, vector *pos );
81 void trail_set_segment( int trail_num, vector *pos );
82 void trail_object_died( int trail_num );
83 int trail_stamp_elapsed( int trail_num );
84 void trail_set_stamp( int trail_num );
85
86 #endif //_TRAILS_H
87