]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/waypointsprites.qc
Merge branch 'master' into Mario/buff_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / waypointsprites.qc
index 2b4ffd68471b21e49aafa4106e71905550d8f34d..0b32de7e920b5e598d1a3aaed844f8f1f22941cb 100644 (file)
@@ -1,4 +1,20 @@
 #include "waypointsprites.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "teamradar.qh"
+
+#include "../common/buffs.qh"
+#include "../common/constants.qh"
+#include "../common/teams.qh"
+
+#include "../common/weapons/all.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
+#include "../warpzonelib/mathlib.qh"
+
+.float alpha;
 
 void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
 {
@@ -38,7 +54,7 @@ void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, f
        R_EndPolygon();
 }
 
-void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float height, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f)
+void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float theheight, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f)
 {
        vector o, ri, up;
        float owidth; // outer width
@@ -56,13 +72,13 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl
        up = rotate(up, rot);
 
        owidth = width + 2 * border;
-       o = o - up * (margin + border + height) + ri * (sz.x - owidth) * 0.5;
+       o = o - up * (margin + border + theheight) + ri * (sz.x - owidth) * 0.5;
 
        drawquad(o - up * border,                               ri * owidth,    up * border, "", rgb,  a,  f);
-       drawquad(o + up * height,                               ri * owidth,    up * border, "", rgb,  a,  f);
-       drawquad(o,                                             ri * border,    up * height, "", rgb,  a,  f);
-       drawquad(o + ri * (owidth - border),                    ri * border,    up * height, "", rgb,  a,  f);
-       drawquad(o + ri * (border + align * ((1 - h) * width)), ri * width * h, up * height, "", hrgb, ha, f);
+       drawquad(o + up * theheight,                               ri * owidth,    up * border, "", rgb,  a,  f);
+       drawquad(o,                                             ri * border,    up * theheight, "", rgb,  a,  f);
+       drawquad(o + ri * (owidth - border),                    ri * border,    up * theheight, "", rgb,  a,  f);
+       drawquad(o + ri * (border + align * ((1 - h) * width)), ri * width * h, up * theheight, "", hrgb, ha, f);
 }
 
 // returns location of sprite text
@@ -130,13 +146,13 @@ vector drawspritetext(vector o, float ang, float minwidth, vector rgb, float a,
 
        // we want to be onscreen
        if(o.x < 0)
-               o_x = 0;
+               o.x = 0;
        if(o.y < 0)
-               o_y = 0;
+               o.y = 0;
        if(o.x > vid_conwidth - w)
-               o_x = vid_conwidth - w;
+               o.x = vid_conwidth - w;
        if(o.y > vid_conheight - h)
-               o_x = vid_conheight - h;
+               o.x = vid_conheight - h;
 
        o.x += 0.5 * (w - sw);
 
@@ -257,13 +273,13 @@ vector fixrgbexcess(vector rgb)
                {
                        rgb = fixrgbexcess_move(rgb, '0 1 0', '0 0 1');
                        if(rgb.z > 1)
-                               rgb_z = 1;
+                               rgb.z = 1;
                }
                else if(rgb.z > 1)
                {
                        rgb = fixrgbexcess_move(rgb, '0 0 1', '0 1 0');
                        if(rgb.y > 1)
-                               rgb_y = 1;
+                               rgb.y = 1;
                }
        }
        else if(rgb.y > 1)
@@ -273,13 +289,13 @@ vector fixrgbexcess(vector rgb)
                {
                        rgb = fixrgbexcess_move(rgb, '1 0 0', '0 0 1');
                        if(rgb.z > 1)
-                               rgb_z = 1;
+                               rgb.z = 1;
                }
                else if(rgb.z > 1)
                {
                        rgb = fixrgbexcess_move(rgb, '0 0 1', '1 0 0');
                        if(rgb.x > 1)
-                               rgb_x = 1;
+                               rgb.x = 1;
                }
        }
        else if(rgb.z > 1)
@@ -289,13 +305,13 @@ vector fixrgbexcess(vector rgb)
                {
                        rgb = fixrgbexcess_move(rgb, '1 0 0', '0 1 0');
                        if(rgb.y > 1)
-                               rgb_y = 1;
+                               rgb.y = 1;
                }
                else if(rgb.y > 1)
                {
                        rgb = fixrgbexcess_move(rgb, '0 1 0', '1 0 0');
                        if(rgb.x > 1)
-                               rgb_x = 1;
+                               rgb.x = 1;
                }
        }
        return rgb;
@@ -459,7 +475,7 @@ void Draw_WaypointSprite()
                ang = atan2(-d.x, -d.y);
 #endif
        }
-       o_z = 0;
+       o.z = 0;
 
        float edgedistance_min, crosshairdistance;
                edgedistance_min = min((o.y - (vid_conheight * waypointsprite_edgeoffset_top)),