Open source remastering of the Freespace 2 engine
fireballs.cpp File Reference
#include "asteroid/asteroid.h"
#include "cmdline/cmdline.h"
#include "fireball/fireballs.h"
#include "gamesnd/gamesnd.h"
#include "graphics/tmapper.h"
#include "localization/localize.h"
#include "model/model.h"
#include "object/object.h"
#include "parse/parselo.h"
#include "render/3d.h"
#include "ship/ship.h"
#include <stdlib.h>

Go to the source code of this file.


#define WARPHOLE_GROW_TIME   (2.35f)
#define MAX_FIREBALL_LOD   4
#define MAX_FIREBALLS   200
#define MAX_WARP_LOD   0
#define FB_INDEX(fb)   (fb-Fireballs)


void fireball_play_warphole_open_sound (int ship_class, fireball *fb)
void fireball_play_warphole_close_sound (fireball *fb)
void parse_fireball_tbl (const char *filename)
void fireball_parse_tbl ()
void fireball_load_data ()
void fireball_init ()
void fireball_render_DEPRECATED (object *obj)
void fireball_delete (object *obj)
void fireball_delete_all ()
void fireball_set_framenum (int num)
int fireball_is_perishable (object *obj)
int fireball_free_one ()
int fireball_is_warp (object *obj)
void fireball_maybe_play_warp_close_sound (fireball *fb)
void fireball_process_post (object *obj, float frame_time)
float fireball_lifeleft (object *obj)
float fireball_lifeleft_percent (object *obj)
int fireball_get_lod (vec3d *pos, fireball_info *fd, float size)
int fireball_create (vec3d *pos, int fireball_type, int render_type, int parent_obj, float size, int reverse, vec3d *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res, int extra_flags, int warp_open_sound, int warp_close_sound)
void fireball_close ()
void fireballs_page_in ()
void fireball_get_color (int idx, float *red, float *green, float *blue)
int fireball_ship_explosion_type (ship_info *sip)
int fireball_asteroid_explosion_type (asteroid_info *aip)
float fireball_wormhole_intensity (object *obj)
void fireball_render (object *obj, draw_list *scene)


SCP_vector< lod_checkerLOD_checker
int Warp_model
int Knossos_warp_ani_used
fireball Fireballs [MAX_FIREBALLS]
fireball_info Fireball_info [MAX_FIREBALL_TYPES]
int fireball_used [MAX_FIREBALL_TYPES]
int Num_fireballs = 0
int Num_fireball_types = 0
int fireballs_inited = 0
int Warp_glow_bitmap = -1
int Warp_ball_bitmap = -1

Macro Definition Documentation

#define FB_INDEX (   fb)    (fb-Fireballs)

Definition at line 57 of file fireballs.cpp.

#define MAX_FIREBALL_LOD   4

Definition at line 37 of file fireballs.cpp.

#define MAX_FIREBALLS   200

Definition at line 39 of file fireballs.cpp.

#define MAX_WARP_LOD   0

Definition at line 41 of file fireballs.cpp.

#define WARPHOLE_GROW_TIME   (2.35f)

Definition at line 35 of file fireballs.cpp.

Function Documentation

int fireball_asteroid_explosion_type ( asteroid_info aip)

Definition at line 1014 of file fireballs.cpp.

void fireball_close ( )

Called at game shutdown to clean up the fireball system

Definition at line 937 of file fireballs.cpp.

int fireball_create ( vec3d pos,
int  fireball_type,
int  render_type,
int  parent_obj,
float  size,
int  reverse,
vec3d velocity,
float  warp_lifetime,
int  ship_class,
matrix orient_override,
int  low_res,
int  extra_flags,
int  warp_open_sound,
int  warp_close_sound 

Create a fireball, return object index.

Definition at line 788 of file fireballs.cpp.

void fireball_delete ( object obj)

Delete a fireball. Called by object_delete() code... do not call directly.

Definition at line 458 of file fireballs.cpp.

void fireball_delete_all ( )

Delete all active fireballs, by calling obj_delete directly.

Definition at line 476 of file fireballs.cpp.

int fireball_free_one ( )

There are too many fireballs, so delete the oldest small one to free up a slot.

The fireball slot freed.

Definition at line 571 of file fireballs.cpp.

void fireball_get_color ( int  idx,
float red,
float green,
float blue 

Definition at line 972 of file fireballs.cpp.

int fireball_get_lod ( vec3d pos,
fireball_info fd,
float  size 

Determine LOD to use

Definition at line 705 of file fireballs.cpp.

void fireball_init ( )

Definition at line 342 of file fireballs.cpp.

int fireball_is_perishable ( object obj)

Definition at line 540 of file fireballs.cpp.

int fireball_is_warp ( object obj)

Definition at line 601 of file fireballs.cpp.

float fireball_lifeleft ( object obj)

Returns life left of a fireball in seconds

Definition at line 669 of file fireballs.cpp.

float fireball_lifeleft_percent ( object obj)

Returns life left of a fireball in percent

Definition at line 686 of file fireballs.cpp.

void fireball_load_data ( )

Definition at line 313 of file fireballs.cpp.

void fireball_maybe_play_warp_close_sound ( fireball fb)

Definition at line 619 of file fireballs.cpp.

void fireball_parse_tbl ( )

Definition at line 250 of file fireballs.cpp.

void fireball_play_warphole_close_sound ( fireball fb)

Play warp out sound for warp effect

Definition at line 94 of file fireballs.cpp.

void fireball_play_warphole_open_sound ( int  ship_class,
fireball fb 

Play warp in sound for warp effect

Definition at line 62 of file fireballs.cpp.

void fireball_process_post ( object obj,
float  frame_time 

Definition at line 643 of file fireballs.cpp.

void fireball_render ( object obj,
draw_list scene 

Definition at line 1055 of file fireballs.cpp.

void fireball_render_DEPRECATED ( object obj)

Definition at line 377 of file fireballs.cpp.

void fireball_set_framenum ( int  num)

Definition at line 489 of file fireballs.cpp.

int fireball_ship_explosion_type ( ship_info sip)

Definition at line 993 of file fireballs.cpp.

float fireball_wormhole_intensity ( object obj)

Definition at line 1031 of file fireballs.cpp.

void fireballs_page_in ( )

Definition at line 945 of file fireballs.cpp.

void parse_fireball_tbl ( const char *  filename)

Parse fireball tbl

NOTE: we can't be too trusting here so a tbm will only modify the LOD count, not add an entry

Definition at line 159 of file fireballs.cpp.

Variable Documentation

Definition at line 45 of file fireballs.cpp.

int fireball_used[MAX_FIREBALL_TYPES]

Definition at line 47 of file fireballs.cpp.

fireball Fireballs[MAX_FIREBALLS]

Definition at line 43 of file fireballs.cpp.

int fireballs_inited = 0

Definition at line 52 of file fireballs.cpp.

int Knossos_warp_ani_used

Definition at line 33 of file fireballs.cpp.

SCP_vector<lod_checker> LOD_checker

Definition at line 103 of file weapons.cpp.

int Num_fireball_types = 0

Definition at line 50 of file fireballs.cpp.

int Num_fireballs = 0

Definition at line 49 of file fireballs.cpp.

int Warp_ball_bitmap = -1

Definition at line 55 of file fireballs.cpp.

int Warp_glow_bitmap = -1

Definition at line 54 of file fireballs.cpp.

int Warp_model

Definition at line 32 of file fireballs.cpp.