diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-29 21:39:41 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-29 21:39:41 +0000 |
| commit | 7bc733dc10f3d01985021b7b5d6ae140dd5af6f1 (patch) | |
| tree | c9b0fcd8d128ec9abd40c10dfe4fcf245650a870 /src/game/client/gc_client.h | |
| parent | 0dab7db963e2706182ea120c98f746f5e265c14c (diff) | |
| download | zcatch-7bc733dc10f3d01985021b7b5d6ae140dd5af6f1.tar.gz zcatch-7bc733dc10f3d01985021b7b5d6ae140dd5af6f1.zip | |
large update. cleaned up some code. added new effects for almost everything
Diffstat (limited to 'src/game/client/gc_client.h')
| -rw-r--r-- | src/game/client/gc_client.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/game/client/gc_client.h b/src/game/client/gc_client.h index f1ff02b1..def3cad8 100644 --- a/src/game/client/gc_client.h +++ b/src/game/client/gc_client.h @@ -83,12 +83,89 @@ const int killmsg_max = 5; extern killmsg killmsgs[killmsg_max]; extern int killmsg_current; +// +void send_switch_team(int team); + // various helpers void snd_play_random(int chn, int setid, float vol, vec2 pos); void process_events(int snaptype); void clear_object_pointers(); void reset_projectile_particles(); void send_info(bool start); +inline vec2 random_dir() { return normalize(vec2(frandom()-0.5f, frandom()-0.5f)); } + + +// effects +void effects_update(); +void effect_bullettrail(vec2 pos); +void effect_smoketrail(vec2 pos, vec2 vel); +void effect_explosion(vec2 pos); void effect_air_jump(vec2 pos); void effect_damage_indicator(vec2 pos, vec2 dir); +void effect_playerspawn(vec2 pos); +void effect_playerdeath(vec2 pos); + +// particles +struct particle +{ + void set_default() + { + vel = vec2(0,0); + life_span = 0; + start_size = 32; + end_size = 32; + rot = 0; + rotspeed = 0; + gravity = 0; + friction = 0; + flow_affected = 1.0f; + color = vec4(1,1,1,1); + } + + vec2 pos; + vec2 vel; + + int spr; + + float flow_affected; + + float life_span; + + float start_size; + float end_size; + + float rot; + float rotspeed; + + float gravity; + float friction; + + vec4 color; + + // set by the particle system + float life; + int prev_part; + int next_part; +}; + +enum +{ + PARTGROUP_PROJECTILE_TRAIL=0, + PARTGROUP_EXPLOSIONS, + PARTGROUP_GENERAL, + NUM_PARTGROUPS +}; + +void particle_add(int group, particle *part); +void particle_render(int group); +void particle_update(float time_passed); +void particle_reset(); + +// flow grid +vec2 flow_get(vec2 pos); +void flow_add(vec2 pos, vec2 vel, float size); +void flow_dbg_render(); +void flow_init(); +void flow_update(); + |