]> icculus.org git repositories - taylor/freespace2.git/blob - include/fireballs.h
Initial revision
[taylor/freespace2.git] / include / fireballs.h
1 /*
2  * $Logfile: /Freespace2/code/Fireball/FireBalls.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Prototypes for fireball functions
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:11  root
11  * Initial revision
12  *
13  * 
14  * 8     9/13/99 10:09a Andsager
15  * Add debug console commands to lower model render detail and fireball
16  * LOD for big ship explosiosns.
17  * 
18  * 7     9/06/99 6:57p Jamesa
19  * Cranked down num large fireball explosions.
20  * 
21  * 6     9/06/99 6:14p Jamesa
22  * Reduced max fireball types.
23  * 
24  * 5     8/31/99 10:13p Andsager
25  * Add Knossos warp effect fireball
26  * 
27  * 4     4/28/99 11:13p Dave
28  * Temporary checkin of artillery code.
29  * 
30  * 3     11/05/98 5:55p Dave
31  * Big pass at reducing #includes
32  * 
33  * 2     10/07/98 10:52a Dave
34  * Initial checkin.
35  * 
36  * 1     10/07/98 10:48a Dave
37  * 
38  * 34    5/15/98 3:54p John
39  * Added code so that only "perishable" fireballs get removed.
40  * 
41  * 33    4/15/98 9:42a Adam
42  * added 2 more explosion types (1, actually, but placeholder for 2)
43  * 
44  * 32    4/12/98 9:56a John
45  * Made lighting detail flags work.   Made explosions cast light on
46  * highest.
47  * 
48  * 31    3/30/98 4:02p John
49  * Made machines with < 32 MB of RAM use every other frame of certain
50  * bitmaps.   Put in code to keep track of how much RAM we've malloc'd.
51  * 
52  * 30    3/18/98 12:36p John
53  * Made hardware have nicer looking warp effect
54  * 
55  * 29    2/26/98 10:07p Hoffoss
56  * Rewrote state saving and restoring to fix bugs and simplify the code.
57  * 
58  * 28    2/19/98 4:32p Lawrance
59  * Add asteroid explosion
60  * 
61  * 27    1/23/98 5:06p John
62  * Took L out of vertex structure used B (blue) instead.   Took all small
63  * fireballs out of fireball types and used particles instead.  Fixed some
64  * debris explosion things.  Restructured fireball code.   Restructured
65  * some lighting code.   Made dynamic lighting on by default. Made groups
66  * of lasers only cast one light.  Made fireballs not cast light.
67  * 
68  * 26    1/15/98 4:58p John
69  * Made warp effect use a looping ani.  Made the scaling up & down be in
70  * software.
71  * 
72  * 25    1/15/98 2:32p John
73  * Added code to optionally take a velocity for a fireball.
74  * 
75  * 24    1/02/98 5:04p John
76  * Several explosion related changes.  Made fireballs not be used as
77  * ani's.  Made ship spark system expell particles.  Took away impact
78  * explosion for weapon hitting ship... this needs to get added to weapon
79  * info and makes shield hit more obvious.  Only make sparks when hit
80  * hull, not shields.
81  * 
82  * 23    12/08/97 11:15a John
83  * added parameter to warpout for life.
84  * 
85  * 22    11/01/97 1:49p John
86  * added code to page fireballs in during level load.  Made player warpout
87  * use Adam's new camera movement pattern.  Make ships docked to warping
88  * out ships render correctly.
89  * 
90  * 21    10/24/97 6:24p John
91  * added code to return the life left of a fireball
92  * 
93  * 20    9/14/97 4:49p Lawrance
94  * extern Num_fireballs
95  * 
96  * 19    9/12/97 4:02p John
97  * put in ship warp out effect.
98  * put in dynamic lighting for warp in/out
99  * 
100  * 18    9/09/97 4:49p John
101  * Almost done ship warp in code
102  * 
103  * 17    9/03/97 4:32p John
104  * changed bmpman to only accept ani and pcx's.  made passing .pcx or .ani
105  * to bm_load functions not needed.   Made bmpman keep track of palettes
106  * for bitmaps not mapped into game palettes.
107  * 
108  * 16    8/29/97 2:26p John
109  * first rev of ship warp in effect.  Nothing more than a fireball inside
110  * of freespace, but textest.cpp contains the correct effect code that
111  * needs to be transferred into the game next.
112  * 
113  * 15    8/13/97 9:50p Allender
114  * split *_move into *_process_pre and *_process_post functions.
115  * process_pre functions called before object is moved.  _process_post
116  * functions called after object is moved.  Reordered code in ship_post
117  * and weapon_post for multiplayer
118  * 
119  * 14    8/13/97 12:06p Lawrance
120  * supporting multiple types of fireball explosions
121  * 
122  * 13    7/21/97 11:41a Lawrance
123  * clean up fireballs at the end of each level
124  * 
125  * 12    7/11/97 11:19a Lawrance
126  * fix mem leaks, move save code from State.cpp here
127  * 
128  * 11    7/10/97 1:51p Lawrance
129  * sorting anim fireballs
130  * 
131  * 10    5/14/97 4:08p Lawrance
132  * removing my_index from game arrays
133  * 
134  * 9     3/11/97 10:47p Mike
135  * Add a slew of secondary weapons.
136  * Support exhaust blobs.
137  * Add weapons that spawn weapons.
138  * Add remotely detonatable weapons.
139  * Add heat-seeking missiles.
140  * 
141  * 8     2/17/97 5:18p John
142  * Added a bunch of RCS headers to a bunch of old files that don't have
143  * them.
144  *
145  * $NoKeywords: $
146  */
147
148 #ifndef _FIREBALLS_H
149 #define _FIREBALLS_H
150
151 #include "object.h"
152 #include "cfile.h"
153
154 // these values correspond to the fireball.tbl entries
155 #define FIREBALL_EXPLOSION_MEDIUM       0                               // Used for the 4 little explosions before a ship explodes
156 #define FIREBALL_WARP_EFFECT                    1                               // Used for the warp in / warp out effect
157 #define FIREBALL_KNOSSOS_EFFECT         2                               // Used for the KNOSSOS warp in / warp out effect
158 #define FIREBALL_ASTEROID                               3
159 #define FIREBALL_EXPLOSION_LARGE1       4                               // Used for the big explosion when a ship breaks into pieces
160 #define FIREBALL_EXPLOSION_LARGE2       5                               // Used for the big explosion when a ship breaks into pieces
161 // #define FIREBALL_EXPLOSION_LARGE3    6                               // Used for the big explosion when a ship breaks into pieces
162 #define MAX_FIREBALL_TYPES                              6                               // How many types there are
163
164 #define FIREBALL_NUM_LARGE_EXPLOSIONS 2
165
166 void fireball_init();
167 void fireball_render(object * obj);
168 void fireball_delete( object * obj );
169 void fireball_process_pre(object * obj, float frame_time);
170 void fireball_process_post(object * obj, float frame_time);
171
172 // reversed is for warp_in/out effects
173 // Velocity: If not NULL, the fireball will move at a constant velocity.
174 // warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long.  Only works for warp effect
175 int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0); 
176 void fireball_render_plane(int plane);
177 void fireball_close();
178 void fireball_level_close();
179 void fireball_preload();                // page in warpout effect data
180
181 // Returns 1 if you can remove this fireball
182 int fireball_is_perishable(object * obj);
183
184 // Returns 1 if this fireball is a warp 
185 int fireball_is_warp(object * obj);
186
187 // Returns life left of a fireball in seconds
188 float fireball_lifeleft( object *obj );
189
190 // Returns life left of a fireball in percent
191 float fireball_lifeleft_percent( object *obj );
192
193 // internal function to draw warp grid.
194 extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
195 extern int Warp_glow_bitmap;                    // Internal
196
197 #endif /* _FIREBALLS_H */
198