Xonotic
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.

References entity(), and NEW.

4 {
5  entity me;
7  me.configureXonoticCrosshairPreview(me);
8  return me;
9 }
#define NEW(cname,...)
Definition: oo.qh:105
entity() spawn
+ Here is the call graph for this function:

◆ XonoticCrosshairPreview_configureXonoticCrosshairPreview()

void XonoticCrosshairPreview_configureXonoticCrosshairPreview ( entity  me)

Definition at line 11 of file crosshairpreview.qc.

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

12 {
13  me.src = strzone(strcat("/gfx/crosshair", cvar_string("crosshair")));
14  me.src2 = "/gfx/crosshairdot";
15 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
+ Here is the call graph for this function:

◆ XonoticCrosshairPreview_draw()

void XonoticCrosshairPreview_draw ( entity  me)

Definition at line 17 of file crosshairpreview.qc.

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

18 {
19  float save;
20  save = draw_alpha;
21  if(me.disabled)
22  draw_alpha *= me.disabledAlpha;
23 
24  vector sz, rgb;
25  float a;
26  rgb = stov(cvar_string("crosshair_color"));
27  a = cvar("crosshair_alpha");
28  strcpy(me.src, strcat("/gfx/crosshair", cvar_string("crosshair")));
29 
30  sz = draw_PictureSize(me.src);
31  sz = globalToBoxSize(sz, me.size);
32  sz = sz * cvar("crosshair_size");
33 
34  draw_Picture('0.5 0.5 0' - 0.5 * sz, me.src, sz, rgb, a);
35  if(cvar("crosshair_dot"))
36  {
37  if(cvar("crosshair_dot_color_custom") && (cvar_string("crosshair_dot_color") != "0"))
38  rgb = stov(cvar_string("crosshair_dot_color"));
39 
40  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"));
41  }
42 
43  draw_alpha = save;
44 
46 }
#define strcpy(this, s)
Definition: string.qh:49
#define SUPER(cname)
Definition: oo.qh:219
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function: