From 8624a9110ad3d9839749b658d745e07293d7dbb6 Mon Sep 17 00:00:00 2001 From: div0 Date: Mon, 25 Aug 2008 07:23:38 +0000 Subject: [PATCH] improve the stupid workaround path for the hook drawing git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4180 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/hook.qc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/data/qcsrc/client/hook.qc b/data/qcsrc/client/hook.qc index 6957efa5d..c33362e1f 100644 --- a/data/qcsrc/client/hook.qc +++ b/data/qcsrc/client/hook.qc @@ -51,10 +51,7 @@ void Draw_GrapplingHookLine(vector from, vector to, float thickness, vector org, C = to + thickdir * (thickness / 2); D = to - thickdir * (thickness / 2); - if(checkextension("DP_SV_WRITEPICTURE")) - R_BeginPolygon(texture, 0); - else - R_BeginPolygon("", 0); + R_BeginPolygon(texture, 0); R_PolygonVertex(A, '0 0 0' + t * '1 0 0', rgb, 1); R_PolygonVertex(B, '0 1 0' + t * '1 0 0', rgb, 1); R_PolygonVertex(C, '0 1 0' + (t + length_tex) * '1 0 0', rgb, 1); @@ -68,6 +65,7 @@ void Draw_GrapplingHook() vector a, b, o; entity e; string tex; + vector rgb; o = pmove_org + '0 0 1' * getstati(STAT_VIEWHEIGHT); makevectors(input_angles); @@ -85,15 +83,33 @@ void Draw_GrapplingHook() a = e.HookStart; b = e.HookEnd; if(e.team == COLOR_TEAM1) + { tex = "particles/hook_red"; + rgb = '1 .3 .3'; + } else if(e.team == COLOR_TEAM2) + { tex = "particles/hook_blue"; + rgb = '.3 .3 1'; + } else if(e.team == COLOR_TEAM3) + { tex = "particles/hook_yellow"; + rgb = '1 1 .3'; + } else if(e.team == COLOR_TEAM4) + { tex = "particles/hook_pink"; + rgb = '1 .3 1'; + } else + { tex = "particles/hook_green"; - Draw_GrapplingHookLine(b, a, 8, o, v_forward, tex, 0.25, '1 1 1'); + rgb = '.3 1 .3'; + } + if(checkextension("DP_SV_WRITEPICTURE")) + Draw_GrapplingHookLine(b, a, 8, o, v_forward, tex, 0.25, '1 1 1'); + else + Draw_GrapplingHookLine(b, a, 1, o, v_forward, "", 0.25, rgb); } } -- 2.39.2