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