From e66324147613c5838abc85b951def3388df27e0f Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 19 Jun 2011 18:37:32 +0200 Subject: [PATCH] UNTESTED: better formulas for the arrows --- qcsrc/client/waypointsprites.qc | 34 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index d3dd4f7ec..12e8b9543 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -109,28 +109,34 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl // returns location of sprite text vector drawspritearrow(vector o, float ang, vector rgb, float a, float t) { + float SQRT2 = 1.414; + float BORDER; BORDER = 1.5 * t; + float TSIZE; TSIZE = 8 * t; + float RLENGTH; RLENGTH = 8 * t; + float RWIDTH; RWIDTH = 4 * t; + R_BeginPolygon("", DRAWFLAG_NORMAL); - R_PolygonVertex(o + rotate('-11.5 9.5 0'*t, ang), '0 0 0', '0 0 0', a); - R_PolygonVertex(o + rotate('11.5 9.5 0'*t, ang), '0 0 0', '0 0 0', a); - R_PolygonVertex(o + rotate('0 -2 0'*t, ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eX * -(TSIZE + BORDER * (1 + SQRT2)) + eY * (TSIZE + BORDER), ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eX * (TSIZE + BORDER * (1 + SQRT2)) + eY * (TSIZE + BORDER), ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eY * -( BORDER * SQRT2), ang), '0 0 0', '0 0 0', a); R_EndPolygon(); R_BeginPolygon("", DRAWFLAG_NORMAL); - R_PolygonVertex(o + rotate('-5.5 9.5 0'*t, ang), '0 0 0', '0 0 0', a); - R_PolygonVertex(o + rotate('-5.5 17.5 0'*t, ang), '0 0 0', '0 0 0', a); - R_PolygonVertex(o + rotate('5.5 17.5 0'*t, ang), '0 0 0', '0 0 0', a); - R_PolygonVertex(o + rotate('5.5 9.5 0'*t, ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eX * -(RWIDTH + BORDER) + eY * (TSIZE + BORDER), ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eX * -(RWIDTH + BORDER) + eY * (TSIZE + RLENGTH + BORDER), ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eX * (RWIDTH + BORDER) + eY * (TSIZE + RLENGTH + BORDER), ang), '0 0 0', '0 0 0', a); + R_PolygonVertex(o + rotate(eX * (RWIDTH + BORDER) + eY * (TSIZE + BORDER), ang), '0 0 0', '0 0 0', a); R_EndPolygon(); R_BeginPolygon("", DRAWFLAG_ADDITIVE); - R_PolygonVertex(o + rotate('-8 8 0'*t, ang), '0 0 0', rgb, a); - R_PolygonVertex(o + rotate('8 8 0'*t, ang), '0 0 0', rgb, a); - R_PolygonVertex(o + rotate('0 0 0'*t, ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate(eX * -TSIZE + eY * TSIZE, ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate(eX * TSIZE + eY * TSIZE, ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate('0 0 0', ang), '0 0 0', rgb, a); R_EndPolygon(); R_BeginPolygon("", DRAWFLAG_ADDITIVE); - R_PolygonVertex(o + rotate('-4 8 0'*t, ang), '0 0 0', rgb, a); - R_PolygonVertex(o + rotate('-4 16 0'*t, ang), '0 0 0', rgb, a); - R_PolygonVertex(o + rotate('4 16 0'*t, ang), '0 0 0', rgb, a); - R_PolygonVertex(o + rotate('4 8 0'*t, ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate(eX * -RWIDTH + eY * TSIZE, ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate(eX * -RWIDTH + eY * (TSIZE + RLENGTH), ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate(eX * RWIDTH + eY * (TSIZE + RLENGTH), ang), '0 0 0', rgb, a); + R_PolygonVertex(o + rotate(eX * RWIDTH + eY * TSIZE, ang), '0 0 0', rgb, a); R_EndPolygon(); return -- 2.39.2