Xonotic
crosshairpreview.qc
Go to the documentation of this file.
1 #include "crosshairpreview.qh"
2 
4 {
5  entity me;
7  me.configureXonoticCrosshairPreview(me);
8  return me;
9 }
10 
12 {
13  me.src = strzone(strcat("/gfx/crosshair", cvar_string("crosshair")));
14  me.src2 = "/gfx/crosshairdot";
15 }
16 
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 NEW(cname,...)
Definition: oo.qh:105
void XonoticCrosshairPreview_configureXonoticCrosshairPreview(entity me)
entity makeXonoticCrosshairPreview()
entity() spawn
#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
void XonoticCrosshairPreview_draw(entity me)