]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/miscfunctions.qc
Merge branch 'master' into martin-t/dmgtext2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / miscfunctions.qc
index a0d7b8789c2273ad34ed1cbe9750a2eb795e205c..468cab28bdea6e13b357e56d405b3b9af5d21b0f 100644 (file)
@@ -192,6 +192,15 @@ vector project_3d_to_2d(vector vec)
        return vec;
 }
 
+bool projected_on_screen(vector screen_pos)
+{
+    return screen_pos.z >= 0
+        && screen_pos.x >= 0
+        && screen_pos.y >= 0
+        && screen_pos.x < vid_conwidth
+        && screen_pos.y < vid_conheight;
+}
+
 float expandingbox_sizefactor_from_fadelerp(float fadelerp)
 {
        return 1.2 / (1.2 - fadelerp);
@@ -392,6 +401,8 @@ void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector
        float d;
        vector ringsize, v, t;
        ringsize = radi * '1 1 0';
+       centre = HUD_Shift(centre);
+       ringsize = HUD_Scale(ringsize);
 
        float co = cos(f * 2 * M_PI);
        float si = sin(f * 2 * M_PI);
@@ -609,4 +620,3 @@ vector Accuracy_GetColor(float accuracy)
        color = color + factor * (acc_col[j+1] - color);
        return color;
 }
-