X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmiscfunctions.qc;h=a0d7b8789c2273ad34ed1cbe9750a2eb795e205c;hb=468b023e4b41cbd40bae363aa136b102a63fc811;hp=01b0ee3cb440c09d4b00503500f9a2561d697fd7;hpb=ee7a78f942624de2ab30112a798e3f663cf9cc2f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 01b0ee3cb..a0d7b8789 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -1,8 +1,8 @@ #include "miscfunctions.qh" -#include "hud/all.qh" +#include "hud/_mod.qh" -#include +#include #include @@ -350,6 +350,13 @@ void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, f drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz.y, theAlpha, drawflag, fadelerp); } +void update_mousepos() +{ + mousepos += getmousepos() * autocvar_menu_mouse_speed; + mousepos.x = bound(0, mousepos.x, vid_conwidth); + mousepos.y = bound(0, mousepos.y, vid_conheight); +} + // this draws the triangles of a model DIRECTLY. Don't expect high performance, really... float PolyDrawModelSurface(entity e, float i_s) { @@ -382,15 +389,15 @@ void PolyDrawModel(entity e) void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector rgb, float a, float drawflag) { - float x, y, q, d; + float d; vector ringsize, v, t; ringsize = radi * '1 1 0'; - x = cos(f * 2 * M_PI); - y = sin(f * 2 * M_PI); - q = fabs(x) + fabs(y); - x /= q; - y /= q; + float co = cos(f * 2 * M_PI); + float si = sin(f * 2 * M_PI); + float q = fabs(co) + fabs(si); + co /= q; + si /= q; if(f >= 1) { @@ -523,8 +530,8 @@ void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector if(d > 0) { v = centre; t = '0.5 0.5 0'; - v.x += x * 0.5 * ringsize.x; t += x * '0.5 0.5 0'; - v.y += y * 0.5 * ringsize.y; t += y * '0.5 -0.5 0'; + v.x += co * 0.5 * ringsize.x; t += co * '0.5 0.5 0'; + v.y += si * 0.5 * ringsize.y; t += si * '0.5 -0.5 0'; R_PolygonVertex(v, t, rgb, a); R_EndPolygon(); }