From 91e4c2252b1a07df013cde773d1cead3712bca43 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Tue, 5 Feb 2008 19:11:34 +0000 Subject: added rotate to editor. fixed so that the game handles envelopes --- src/game/client/gc_render.cpp | 18 ++++++++++++++++++ src/game/client/gc_render_map.cpp | 2 +- src/game/client/gc_render_obj.cpp | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src/game/client') diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp index 285b6c1c..f201a87c 100644 --- a/src/game/client/gc_render.cpp +++ b/src/game/client/gc_render.cpp @@ -261,6 +261,24 @@ static void envelope_eval(float time_offset, int env, float *channels) channels[1] = 0; channels[2] = 0; channels[3] = 0; + + ENVPOINT *points; + + { + int start, num; + map_get_type(MAPITEMTYPE_ENVPOINTS, &start, &num); + if(num) + points = (ENVPOINT *)map_get_item(start, 0, 0); + } + + int start, num; + map_get_type(MAPITEMTYPE_ENVELOPE, &start, &num); + + if(env >= num) + return; + + MAPITEM_ENVELOPE *item = (MAPITEM_ENVELOPE *)map_get_item(start+env, 0, 0); + render_eval_envelope(points+item->start_point, item->num_points, 4, client_localtime()+time_offset, channels); } void render_layers(float center_x, float center_y, int pass) diff --git a/src/game/client/gc_render_map.cpp b/src/game/client/gc_render_map.cpp index 4728f771..d5e7f1a0 100644 --- a/src/game/client/gc_render_map.cpp +++ b/src/game/client/gc_render_map.cpp @@ -102,7 +102,7 @@ void render_quads(QUAD *quads, int num_quads, void (*eval)(float time_offset, in eval(q->pos_env_offset/1000.0f, q->pos_env, channels); offset_x = channels[0]; offset_y = channels[1]; - rot = channels[2]; + rot = channels[2]/360.0f*pi*2; } if(q->color_env >= 0) diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp index 1e1d6430..39705444 100644 --- a/src/game/client/gc_render_obj.cpp +++ b/src/game/client/gc_render_obj.cpp @@ -380,7 +380,7 @@ void render_player( if (player.weapon == WEAPON_HAMMER) { // Static position for hammer - p = position; + p = position + vec2(state.attach.x, state.attach.y); p.y += data->weapons[iw].offsety; // if attack is under way, bash stuffs if(direction.x < 0) -- cgit 1.4.1