diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-17 01:03:14 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-17 01:03:14 +0000 |
| commit | ad19e0702efa07fbe7df073ade599573917b9250 (patch) | |
| tree | e2b57dde40772a7534cc50d0c3b3bd92c19e519e /src/game/client | |
| parent | 259d2886334e443f533d27244386e9e003b2cf34 (diff) | |
| download | zcatch-ad19e0702efa07fbe7df073ade599573917b9250.tar.gz zcatch-ad19e0702efa07fbe7df073ade599573917b9250.zip | |
tweaked the rifle and added rifle sounds
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/gc_client.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/gc_render_obj.cpp | 35 |
2 files changed, 22 insertions, 15 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp index 580eb302..df6c3efd 100644 --- a/src/game/client/gc_client.cpp +++ b/src/game/client/gc_client.cpp @@ -805,7 +805,7 @@ void render_game() { INPUT_EVENT e = inp_get_event(i); - if (!(e.ch >= 0 && e.ch < 32)) + if(e.ch > 32) { if (chat_input_len < sizeof(chat_input) - 1) { diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp index 839a5261..5f00b9cf 100644 --- a/src/game/client/gc_render_obj.cpp +++ b/src/game/client/gc_render_obj.cpp @@ -154,8 +154,6 @@ void render_laser(const struct NETOBJ_LASER *current) vec2 from = vec2(current->from_x, current->from_y); vec2 dir = normalize(pos-from); - - float ticks = client_tick() + client_intratick() - current->eval_tick; float ms = (ticks/50.0f) * 1000.0f; float a = ms / tuning.laser_bounce_delay; @@ -171,23 +169,30 @@ void render_laser(const struct NETOBJ_LASER *current) gfx_texture_set(-1); gfx_quads_begin(); - vec4 start_color(0.25f,0.25f,0.5f,1.0f); - vec4 end_color(0.85f,0.85f,1.0f,1.0f); - start_color = end_color; - gfx_setcolorvertex(0, start_color.r, start_color.g, start_color.b, start_color.a); - gfx_setcolorvertex(1, start_color.r, start_color.g, start_color.b, start_color.a); - gfx_setcolorvertex(2, end_color.r, end_color.g, end_color.b, end_color.a); - gfx_setcolorvertex(3, end_color.r, end_color.g, end_color.b, end_color.a); + vec4 inner_color(0.25f,0.25f,0.5f,1.0f); + vec4 outer_color(0.85f,0.85f,1.0f,1.0f); - from = mix(from, pos, a); + gfx_setcolorvertex(0, inner_color.r, inner_color.g, inner_color.b, 0.2f); // center + gfx_setcolorvertex(1, outer_color.r, outer_color.g, outer_color.b, 1.0f); + gfx_setcolorvertex(2, inner_color.r, inner_color.g, inner_color.b, 0.2f); // center + gfx_setcolorvertex(3, outer_color.r, outer_color.g, outer_color.b, 1.0f); + + //from = mix(from, pos, a); gfx_quads_draw_freeform( - from.x-out.x, from.y-out.y, + from.x, from.y, from.x+out.x, from.y+out.y, - pos.x-out.x, pos.y-out.y, + pos.x, pos.y, pos.x+out.x, pos.y+out.y ); + + gfx_quads_draw_freeform( + from.x, from.y, + from.x-out.x, from.y-out.y, + pos.x, pos.y, + pos.x-out.x, pos.y-out.y + ); gfx_quads_end(); @@ -197,12 +202,14 @@ void render_laser(const struct NETOBJ_LASER *current) gfx_texture_set(data->images[IMAGE_PARTICLES].id); gfx_quads_begin(); - gfx_setcolor(end_color.r, end_color.g, end_color.b, end_color.a); + gfx_setcolor(outer_color.r, outer_color.g, outer_color.b, outer_color.a); int sprites[] = {SPRITE_PART_SPLAT01, SPRITE_PART_SPLAT02, SPRITE_PART_SPLAT03}; select_sprite(sprites[client_tick()%3]); gfx_quads_setrotation(client_tick()); - gfx_quads_draw(pos.x, pos.y, 32,32); + gfx_quads_draw(pos.x, pos.y, 24,24); + //gfx_setcolor(inner_color.r, inner_color.g, inner_color.b, 1.0f); + //gfx_quads_draw(pos.x, pos.y, 24,24); gfx_quads_end(); } |