Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
crosshairpreview.qc File Reference
Include dependency graph for crosshairpreview.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

entity makeXonoticCrosshairPreview ()
void XonoticCrosshairPreview_configureXonoticCrosshairPreview (entity me)
void XonoticCrosshairPreview_draw (entity me)

Function Documentation

◆ makeXonoticCrosshairPreview()

entity makeXonoticCrosshairPreview ( )

Definition at line 3 of file crosshairpreview.qc.

4{
6 me.configureXonoticCrosshairPreview(me);
7 return me;
8}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticGameCrosshairSettingsTab_fill().

◆ XonoticCrosshairPreview_configureXonoticCrosshairPreview()

void XonoticCrosshairPreview_configureXonoticCrosshairPreview ( entity me)

Definition at line 10 of file crosshairpreview.qc.

11{
12 me.src = strzone(strcat("/gfx/crosshair", cvar_string("crosshair")));
13 me.src2 = "/gfx/crosshairdot";
14}
const string cvar_string(string name)
string strzone(string s)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References cvar_string(), entity(), strcat(), and strzone().

◆ XonoticCrosshairPreview_draw()

void XonoticCrosshairPreview_draw ( entity me)

Definition at line 16 of file crosshairpreview.qc.

17{
18 float save = draw_alpha;
19 if(me.disabled)
20 draw_alpha *= me.disabledAlpha;
21
22 vector sz, rgb;
23 float a;
24 rgb = stov(cvar_string("crosshair_color"));
25 a = cvar("crosshair_alpha");
26 strcpy(me.src, strcat("/gfx/crosshair", cvar_string("crosshair")));
27
28 sz = draw_PictureSize(me.src);
29 sz = globalToBoxSize(sz, me.size);
30 sz *= cvar("crosshair_size");
31
32 draw_Picture('0.5 0.5 0' - 0.5 * sz, me.src, sz, rgb, a);
33 if(cvar("crosshair_dot"))
34 {
35 if(cvar("crosshair_dot_color_custom") && (cvar_string("crosshair_dot_color") != "0"))
36 rgb = stov(cvar_string("crosshair_dot_color"));
37
38 draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src2, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha"));
39 }
40
41 draw_alpha = save;
42
44}
void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha)
Definition draw.qc:72
vector draw_PictureSize(string pic)
Definition draw.qc:80
vector globalToBoxSize(vector v, vector theScale)
Definition draw.qc:38
float draw_alpha
Definition draw.qh:9
float cvar(string name)
vector stov(string s)
#define SUPER(cname)
Definition oo.qh:231
vector
Definition self.qh:92
#define strcpy(this, s)
Definition string.qh:52

References cvar(), cvar_string(), draw_alpha, draw_Picture(), draw_PictureSize(), entity(), globalToBoxSize(), stov(), strcat(), strcpy, SUPER, and vector.