FS2_Open
Open source remastering of the Freespace 2 engine
shockwave.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __SHOCKWAVE_H__
13 #define __SHOCKWAVE_H__
14 
15 #include "globalincs/globals.h"
16 #include "globalincs/pstypes.h"
17 
18 class object;
19 class draw_list;
20 
21 #define SW_USED (1<<0)
22 #define SW_WEAPON (1<<1)
23 #define SW_SHIP_DEATH (1<<2)
24 #define SW_WEAPON_KILL (1<<3) // Shockwave created when weapon destroyed by another
25 
26 #define MAX_SHOCKWAVES 16
27 #define SW_MAX_OBJS_HIT 64
28 
29 // -----------------------------------------------------------
30 // Data structures
31 // -----------------------------------------------------------
32 
33 typedef struct shockwave_info
34 {
36  int bitmap_id;
37  int model_id;
39  int fps;
40 
42  : num_frames( 0 ), fps( 0 )
43  {
44  filename[ 0 ] = '\0';
45  bitmap_id = -1;
46  model_id = -1;
47  }
49 
50 typedef struct shockwave {
52  int flags;
53  int objnum; // index into Objects[] for shockwave
56  float speed, radius;
58  int weapon_info_index; // -1 if shockwave not caused by weapon
59  int damage_type_idx; //What type of damage this shockwave does to armor
61  float blast; // amount of blast to apply
62  int next_blast; // timestamp for when to apply next blast damage
65  float time_elapsed; // in seconds
66  float total_time; // total lifetime of animation in seconds
67  int delay_stamp; // for delayed shockwaves
69  int model_id;
70 } shockwave;
71 
72 typedef struct shockwave_create_info {
73 
76 
77  float inner_rad;
78  float outer_rad;
79  float damage;
80  float blast;
81  float speed;
83 
85  int damage_type_idx_sav; // stored value from table used to reset damage_type_idx
86 
88 
91 
94 void shockwave_delete(object *objp);
95 void shockwave_move_all(float frametime);
96 int shockwave_create(int parent_objnum, vec3d *pos, shockwave_create_info *sci, int flag, int delay = -1);
97 void shockwave_render_DEPRECATED(object *objp);
98 void shockwave_render(object *objp, draw_list *scene);
99 int shockwave_load(char *s_name, bool shock_3D = false);
100 
104 float shockwave_get_damage(int index);
106 int shockwave_get_framenum(int index, int num_frames);
107 int shockwave_get_flags(int index);
108 
109 #endif /* __SHOCKWAVE_H__ */
struct shockwave shockwave
void shockwave_level_close()
Definition: shockwave.cpp:672
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
int model_id
Definition: shockwave.h:69
int damage_type_idx
Definition: shockwave.h:59
struct shockwave_info shockwave_info
int shockwave_get_flags(int index)
Definition: shockwave.cpp:786
int shockwave_info_index
Definition: shockwave.h:63
GLuint index
Definition: Glext.h:5608
int shockwave_get_weapon_index(int index)
Definition: shockwave.cpp:741
int num_objs_hit
Definition: shockwave.h:54
Definition: pstypes.h:88
float total_time
Definition: shockwave.h:66
float damage
Definition: shockwave.h:57
shockwave * prev
Definition: shockwave.h:51
float shockwave_get_min_radius(int index)
Definition: shockwave.cpp:759
struct shockwave_create_info shockwave_create_info
void shockwave_delete(object *objp)
Definition: shockwave.cpp:159
float inner_radius
Definition: shockwave.h:57
object * objp
Definition: lua.cpp:3105
int shockwave_load(char *s_name, bool shock_3D=false)
Definition: shockwave.cpp:538
char pof_name[MAX_FILENAME_LEN]
Definition: shockwave.h:75
int objnum
Definition: shockwave.h:53
int shockwave_create(int parent_objnum, vec3d *pos, shockwave_create_info *sci, int flag, int delay=-1)
Definition: shockwave.cpp:64
int shockwave_get_damage_type_idx(int index)
Definition: shockwave.cpp:777
void shockwave_render(object *objp, draw_list *scene)
Definition: shockwave.cpp:462
shockwave * next
Definition: shockwave.h:51
float radius
Definition: shockwave.h:56
float speed
Definition: shockwave.h:56
float time_elapsed
Definition: shockwave.h:65
void shockwave_move_all(float frametime)
Definition: shockwave.cpp:709
int next_blast
Definition: shockwave.h:62
float outer_radius
Definition: shockwave.h:57
angles rot_angles
Definition: shockwave.h:68
int flags
Definition: shockwave.h:52
void shockwave_create_info_load(shockwave_create_info *sci)
Definition: shockwave.cpp:825
int obj_sig_hitlist[SW_MAX_OBJS_HIT]
Definition: shockwave.h:55
float blast
Definition: shockwave.h:61
Definition: object.h:141
int current_bitmap
Definition: shockwave.h:64
GLuint const GLchar * name
Definition: Glext.h:5608
void shockwave_render_DEPRECATED(object *objp)
Definition: shockwave.cpp:388
float shockwave_get_max_radius(int index)
Definition: shockwave.cpp:750
void shockwave_create_info_init(shockwave_create_info *sci)
Definition: shockwave.cpp:811
int weapon_info_index
Definition: shockwave.h:58
vec3d pos
Definition: shockwave.h:60
int delay_stamp
Definition: shockwave.h:67
hull_check pos
Definition: lua.cpp:5050
int shockwave_get_framenum(int index, int num_frames)
Definition: shockwave.cpp:222
#define SW_MAX_OBJS_HIT
Definition: shockwave.h:27
char filename[MAX_FILENAME_LEN]
Definition: shockwave.h:35
float shockwave_get_damage(int index)
Definition: shockwave.cpp:768
void shockwave_level_init()
Definition: shockwave.cpp:595