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