]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/waypointsprites.qc
Merge branch 'master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / waypointsprites.qc
index 1c53eb7fe4750b9b329319fe44bf01d07350cc8b..24b200d3467d0d3378b50632ed09672a3e6cc402 100644 (file)
@@ -115,39 +115,31 @@ 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;
-       float MLENGTH; MLENGTH = 4 * t;
+       float size   = 9.0 * t;
+       float border = 1.5 * t;
+       float margin = 4.0 * t;
+
+       float borderDiag = border * 1.414;
+       vector arrowX  = eX * size;
+       vector arrowY  = eY * (size+borderDiag);
+       vector borderX = eX * (size+borderDiag);
+       vector borderY = eY * (size+borderDiag+border);
 
        R_BeginPolygon("", DRAWFLAG_NORMAL);
-       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(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_PolygonVertex(o,                                  '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(arrowY  - borderX, ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(borderY - borderX, ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(borderY + borderX, ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(arrowY  + borderX, ang), '0 0 0', '0 0 0', a);
        R_EndPolygon();
 
        R_BeginPolygon("", DRAWFLAG_ADDITIVE);
-       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(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_PolygonVertex(o + rotate(eY * borderDiag, ang), '0 0 0', rgb, a);
+       R_PolygonVertex(o + rotate(arrowY - arrowX, ang), '0 0 0', rgb, a);
+       R_PolygonVertex(o + rotate(arrowY + arrowX, ang), '0 0 0', rgb, a);
        R_EndPolygon();
 
-       return
-               o + rotate(eY * (TSIZE + RLENGTH + MLENGTH), ang);
+       return o + rotate(eY * (borderDiag+size+margin), ang);
 }
 
 // returns location of sprite healthbar
@@ -275,6 +267,7 @@ string spritelookuptext(string s)
                case "race-finish": return _("Finish");
                case "race-start": return _("Start");
                case "race-start-finish": return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
+               case "goal": return _("Goal");
                case "nb-ball": return _("Ball");
                case "ka-ball": return _("Ball");
                case "ka-ballcarrier": return _("Ball carrier");
@@ -431,7 +424,7 @@ void Draw_WaypointSprite()
        if(rgb == '0 0 0')
        {
                self.teamradar_color = '1 0 1';
-               print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
+               printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
        }
 
        if(time - floor(time) > 0.5)