]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/waypointsprites.qc
Merge branch 'TimePath/qc_updates' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / waypointsprites.qc
index de6970b38cd15247b384899e3aa32649ff4d62ae..dc38219b510c8442620cc27c701dec8258eb8d4d 100644 (file)
@@ -1,51 +1,20 @@
-float waypointsprite_initialized;
-float waypointsprite_fadedistance;
-float waypointsprite_normdistance;
-float waypointsprite_minscale;
-float waypointsprite_minalpha;
-float waypointsprite_distancealphaexponent;
-float waypointsprite_timealphaexponent;
-float waypointsprite_scale;
-float waypointsprite_fontsize;
-float waypointsprite_edgefadealpha;
-float waypointsprite_edgefadescale;
-float waypointsprite_edgefadedistance;
-float waypointsprite_edgeoffset_bottom;
-float waypointsprite_edgeoffset_left;
-float waypointsprite_edgeoffset_right;
-float waypointsprite_edgeoffset_top;
-float waypointsprite_crosshairfadealpha;
-float waypointsprite_crosshairfadescale;
-float waypointsprite_crosshairfadedistance;
-float waypointsprite_distancefadealpha;
-float waypointsprite_distancefadescale;
-float waypointsprite_distancefadedistance;
-float waypointsprite_alpha;
-
-.float helpme;
-.float rule;
-.string netname; // primary picture
-.string netname2; // secondary picture
-.string netname3; // tertiary picture
-.float team; // team that gets netname2
-.float lifetime;
-.float fadetime;
-.float maxdistance;
-.int hideflags;
-.float spawntime;
-.float health;
-.float build_started;
-.float build_starthealth;
-.float build_finished;
-
-const float SPRITE_HEALTHBAR_WIDTH = 144;
-const float SPRITE_HEALTHBAR_HEIGHT = 9;
-const float SPRITE_HEALTHBAR_MARGIN = 6;
-const float SPRITE_HEALTHBAR_BORDER = 2;
-const float SPRITE_HEALTHBAR_BORDERALPHA = 1;
-const float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
-const float SPRITE_ARROW_SCALE = 1.0;
-const float SPRITE_HELPME_BLINK = 2;
+#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/weapons.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)
 {
@@ -177,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);
 
@@ -304,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)
@@ -320,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)
@@ -336,19 +305,18 @@ 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;
 }
 
-float waypointsprite_count, waypointsprite_newcount;
 void Draw_WaypointSprite()
 {
        string spriteimage;
@@ -507,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)),