Xonotic
crosshair.qc File Reference
+ Include dependency graph for crosshair.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CROSSHAIR_DO_BLUR(M, sz, wcross_name, wcross_alpha)
 
#define CROSSHAIR_DRAW(sz, wcross_name, wcross_alpha)   CROSSHAIR_DO_BLUR(CROSSHAIR_DRAW_SINGLE,sz,wcross_name,wcross_alpha)
 
#define CROSSHAIR_DRAW_SINGLE(i, j, sz, scaled_sz, wcross_name, wcross_alpha)   drawpic(wcross_origin - ('0.5 0 0' * (scaled_sz.x + i * wcross_blur) + '0 0.5 0' * (scaled_sz.y + j * wcross_blur)), wcross_name, scaled_sz, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
 

Functions

vector crosshair_getcolor (entity this, float health_stat)
 
void DrawReticle (entity this)
 
float EnemyHitCheck ()
 
void HUD_Crosshair (entity this)
 
void HUD_Crosshair_ApplyPlayerAlpha (float new_alpha)
 
void HUD_Crosshair_Vehicle (entity this)
 
void TrueAim_Init ()
 
float TrueAimCheck (entity wepent)
 

Variables

float hitindication_crosshair_size
 
float pickup_crosshair_size
 
float pickup_crosshair_time
 
float reticle_type
 
const float SHOTTYPE_HITENEMY = 4
 
const float SHOTTYPE_HITOBSTRUCTION = 2
 
const float SHOTTYPE_HITTEAM = 1
 
const float SHOTTYPE_HITWORLD = 3
 
entity tag_entity
 
entity trueaim
 
entity trueaim_rifle
 
float use_vortex_chargepool
 
float wcross_alpha_goal_prev
 
float wcross_alpha_prev
 
float wcross_changedonetime
 
vector wcross_color_goal_prev
 
vector wcross_color_prev
 
float wcross_name_alpha_goal_prev
 
float wcross_name_alpha_goal_prev_prev
 
float wcross_name_changedonetime
 
float wcross_name_changestarttime
 
string wcross_name_goal_prev
 
string wcross_name_goal_prev_prev
 
vector wcross_origin
 
float wcross_resolution_goal_prev
 
float wcross_resolution_goal_prev_prev
 
float wcross_ring_prev
 
float wcross_scale_goal_prev
 
float wcross_scale_prev
 

Macro Definition Documentation

◆ CROSSHAIR_DO_BLUR

#define CROSSHAIR_DO_BLUR (   M,
  sz,
  wcross_name,
  wcross_alpha 
)
Value:
MACRO_BEGIN \
vector scaled_sz = sz * wcross_size; \
if(wcross_blur > 0) \
{ \
for(i = -2; i <= 2; ++i) \
for(j = -2; j <= 2; ++j) \
M(i,j,sz,scaled_sz,wcross_name,wcross_alpha*0.04); \
} \
else \
{ \
M(0,0,sz,scaled_sz,wcross_name,wcross_alpha); \
} \
MACRO_END

◆ CROSSHAIR_DRAW

#define CROSSHAIR_DRAW (   sz,
  wcross_name,
  wcross_alpha 
)    CROSSHAIR_DO_BLUR(CROSSHAIR_DRAW_SINGLE,sz,wcross_name,wcross_alpha)

Referenced by HUD_Crosshair().

◆ CROSSHAIR_DRAW_SINGLE

#define CROSSHAIR_DRAW_SINGLE (   i,
  j,
  sz,
  scaled_sz,
  wcross_name,
  wcross_alpha 
)    drawpic(wcross_origin - ('0.5 0 0' * (scaled_sz.x + i * wcross_blur) + '0 0.5 0' * (scaled_sz.y + j * wcross_blur)), wcross_name, scaled_sz, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)

Function Documentation

◆ crosshair_getcolor()

vector crosshair_getcolor ( entity  this,
float  health_stat 
)

Definition at line 174 of file crosshair.qc.

References armorblockpercent, autocvar_crosshair_color, autocvar_crosshair_color_special, autocvar_crosshair_color_special_rainbow_brightness, autocvar_crosshair_color_special_rainbow_delay, floor(), hud, HUD_Get_Num_Color(), LABEL, randomvec(), stov(), time, v, and vector().

Referenced by HUD_Crosshair(), and Vehicles_drawCrosshair().

175 {
176  static float rainbow_last_flicker;
177  static vector rainbow_prev_color;
178  vector wcross_color = '0 0 0';
180  {
181  case 1: // weapon color
182  {
183  if(this != WEP_Null && hud == HUD_NORMAL)
184  {
185  wcross_color = this.wpcolor;
186  break;
187  }
188  else { goto normalcolor; }
189  }
190 
191  case 2: // color based on health and armor
192  {
193  vector v = healtharmor_maxdamage(health_stat, STAT(ARMOR), armorblockpercent, DEATH_WEAPON.m_id);
194  float health_and_armor = floor(v.x + 1);
195  wcross_color = HUD_Get_Num_Color(health_and_armor, 200, false);
196  break;
197  }
198 
199  case 3: // rainbow/random color
200  {
201  if(time >= rainbow_last_flicker)
202  {
204  rainbow_last_flicker = time + autocvar_crosshair_color_special_rainbow_delay;
205  }
206  wcross_color = rainbow_prev_color;
207  break;
208  }
209 LABEL(normalcolor)
210  default: { wcross_color = stov(autocvar_crosshair_color); break; }
211  }
212 
213  return wcross_color;
214 }
string autocvar_crosshair_color
Definition: crosshair.qh:11
float autocvar_crosshair_color_special_rainbow_delay
Definition: crosshair.qh:14
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float autocvar_crosshair_color_special_rainbow_brightness
Definition: crosshair.qh:13
vector v
Definition: ent_cs.qc:116
vector HUD_Get_Num_Color(float hp, float maxvalue, bool blink)
Definition: hud.qc:123
#define LABEL(id)
Definition: compiler.qh:36
float time
Definition: csprogsdefs.qc:16
int autocvar_crosshair_color_special
Definition: crosshair.qh:12
float armorblockpercent
Definition: main.qh:130
int hud
Definition: main.qh:142
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawReticle()

void DrawReticle ( entity  this)

Definition at line 678 of file crosshair.qc.

References autocvar_cl_reticle, autocvar_cl_reticle_normal_alpha, autocvar_cl_reticle_stretch, autocvar_cl_reticle_weapon, autocvar_cl_reticle_weapon_alpha, button_zoom, current_zoomfraction, DRAWFLAG_NORMAL, drawpic(), DrawReticle(), entity(), hud, max(), MAX_WEAPONSLOTS, MUTATOR_CALLHOOK, NULL, reticle_type, spectatee_status, string_null, vector(), vid_conheight, vid_conwidth, viewloc, viewmodels, Weapon::w_reticle, and zoomscript_caught.

Referenced by CSQC_UpdateView(), and DrawReticle().

679 {
681  {
682  reticle_type = 0;
683  return;
684  }
685 
686  float is_dead = (STAT(HEALTH) <= 0);
687  string reticle_image = string_null;
688  bool wep_zoomed = false;
689  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
690  {
691  entity wepe = viewmodels[slot];
692  Weapon wep = wepe.activeweapon;
693  if(wep != WEP_Null && wep.wr_zoom)
694  {
695  bool do_zoom = wep.wr_zoom(wep, NULL);
696  if(!reticle_image && wep.w_reticle && wep.w_reticle != "")
697  reticle_image = wep.w_reticle;
698  wep_zoomed += do_zoom;
699  }
700  }
701  // Draw the aiming reticle for weapons that use it
702  // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
703  // It must be a persisted float for fading out to work properly (you let go of the zoom button for
704  // the view to go back to normal, so reticle_type would become 0 as we fade out)
705  if(spectatee_status || is_dead || hud != HUD_NORMAL || this.viewloc)
706  {
707  // no zoom reticle while dead
708  reticle_type = 0;
709  }
710  else if(wep_zoomed && autocvar_cl_reticle_weapon)
711  {
712  if(reticle_image) { reticle_type = 2; }
713  else { reticle_type = 0; }
714  }
715  else if(button_zoom || zoomscript_caught)
716  {
717  // normal zoom
718  reticle_type = 1;
719  }
720 
721  if(reticle_type)
722  {
723  vector reticle_pos = '0 0 0', reticle_size = '0 0 0';
725  {
726  reticle_size.x = vid_conwidth;
727  reticle_size.y = vid_conheight;
728  reticle_pos.x = 0;
729  reticle_pos.y = 0;
730  }
731  else
732  {
733  reticle_size.x = max(vid_conwidth, vid_conheight);
734  reticle_size.y = max(vid_conwidth, vid_conheight);
735  reticle_pos.x = (vid_conwidth - reticle_size.x) / 2;
736  reticle_pos.y = (vid_conheight - reticle_size.y) / 2;
737  }
738 
739  float f = (zoomscript_caught) ? 1 : current_zoomfraction;
740 
741  if(f)
742  {
743  switch(reticle_type)
744  {
745  case 1: drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_normal_alpha, DRAWFLAG_NORMAL); break;
746  case 2: if(reticle_image) drawpic(reticle_pos, reticle_image, reticle_size, '1 1 1', f * autocvar_cl_reticle_weapon_alpha, DRAWFLAG_NORMAL); break;
747  }
748  }
749  }
750 }
bool autocvar_cl_reticle_stretch
Definition: crosshair.qh:7
float vid_conheight
string string_null
Definition: nil.qh:9
float zoomscript_caught
Definition: view.qh:117
void DrawReticle(entity this)
Definition: crosshair.qc:678
entity viewmodels[MAX_WEAPONSLOTS]
Definition: view.qh:104
entity() spawn
float vid_conwidth
bool autocvar_cl_reticle
Definition: crosshair.qh:3
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define NULL
Definition: post.qh:17
float current_zoomfraction
Definition: main.qh:117
const float DRAWFLAG_NORMAL
Definition: csprogsdefs.qc:317
bool autocvar_cl_reticle_weapon
Definition: crosshair.qh:5
float autocvar_cl_reticle_normal_alpha
Definition: crosshair.qh:4
bool button_zoom
Definition: main.qh:97
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float reticle_type
Definition: crosshair.qc:22
entity viewloc
Definition: viewloc.qh:13
float spectatee_status
Definition: main.qh:166
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
float autocvar_cl_reticle_weapon_alpha
Definition: crosshair.qh:6
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
string w_reticle
A: reticle : per-weapon zoom reticle.
Definition: weapon.qh:72
int hud
Definition: main.qh:142
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnemyHitCheck()

float EnemyHitCheck ( )

Definition at line 52 of file crosshair.qc.

References maxclients, NUM_SPECTATOR, project_3d_to_2d(), SHOTTYPE_HITENEMY, SHOTTYPE_HITTEAM, SHOTTYPE_HITWORLD, teamplay, trace_endpos, trace_ent, trace_networkentity, and wcross_origin.

Referenced by TrueAimCheck().

53 {
54  float t, n;
56  wcross_origin.z = 0;
57  if(trace_ent)
58  n = trace_ent.entnum;
59  else
61  if(n < 1)
62  return SHOTTYPE_HITWORLD;
63  if(n > maxclients)
64  return SHOTTYPE_HITWORLD;
65  t = entcs_GetTeam(n - 1);
66  if(teamplay)
67  if(t == myteam)
68  return SHOTTYPE_HITTEAM;
69  if(t == NUM_SPECTATOR)
70  return SHOTTYPE_HITWORLD;
71  return SHOTTYPE_HITENEMY;
72 }
const int NUM_SPECTATOR
Definition: teams.qh:23
const float SHOTTYPE_HITENEMY
Definition: crosshair.qc:44
vector project_3d_to_2d(vector vec)
Definition: view.qc:359
float trace_networkentity
float maxclients
Definition: csprogsdefs.qc:21
vector wcross_origin
Definition: crosshair.qc:24
entity trace_ent
Definition: csprogsdefs.qc:40
vector trace_endpos
Definition: csprogsdefs.qc:37
float teamplay
Definition: progsdefs.qc:31
const float SHOTTYPE_HITTEAM
Definition: crosshair.qc:41
const float SHOTTYPE_HITWORLD
Definition: crosshair.qc:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Crosshair()

void HUD_Crosshair ( entity  this)

Definition at line 226 of file crosshair.qc.

References autocvar__menu_alpha, autocvar_chase_active, autocvar_chase_front, autocvar_cl_lockview, autocvar_crosshair, autocvar_crosshair_2d, autocvar_crosshair_alpha, autocvar_crosshair_chase, autocvar_crosshair_chase_playeralpha, autocvar_crosshair_color_special, autocvar_crosshair_dot, autocvar_crosshair_dot_alpha, autocvar_crosshair_dot_color, autocvar_crosshair_dot_color_custom, autocvar_crosshair_dot_size, autocvar_crosshair_effect_scalefade, autocvar_crosshair_effect_time, autocvar_crosshair_enabled, autocvar_crosshair_hitindication, autocvar_crosshair_hitindication_color, autocvar_crosshair_hitindication_per_weapon_color, autocvar_crosshair_hitindication_speed, autocvar_crosshair_hittest, autocvar_crosshair_hittest_blur_teammate, autocvar_crosshair_hittest_blur_wall, autocvar_crosshair_hittest_showimpact, autocvar_crosshair_per_weapon, autocvar_crosshair_pickup, autocvar_crosshair_pickup_speed, autocvar_crosshair_ring, autocvar_crosshair_ring_arc, autocvar_crosshair_ring_arc_cold_alpha, autocvar_crosshair_ring_arc_hot_alpha, autocvar_crosshair_ring_arc_hot_color, autocvar_crosshair_ring_hagar, autocvar_crosshair_ring_hagar_alpha, autocvar_crosshair_ring_inner, autocvar_crosshair_ring_minelayer, autocvar_crosshair_ring_minelayer_alpha, autocvar_crosshair_ring_reload, autocvar_crosshair_ring_reload_alpha, autocvar_crosshair_ring_reload_size, autocvar_crosshair_ring_size, autocvar_crosshair_ring_vortex, autocvar_crosshair_ring_vortex_alpha, autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate, autocvar_crosshair_ring_vortex_currentcharge_scale, autocvar_crosshair_ring_vortex_inner_alpha, autocvar_crosshair_ring_vortex_inner_color_blue, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_size, bound(), camera_active, CROSSHAIR_DRAW, crosshair_getcolor(), csqcplayer, DrawCircleClippedPic(), DRAWFLAG_ADDITIVE, entity(), fabs(), frametime, hitindication_crosshair_size, hud, HUD_Crosshair_ApplyPlayerAlpha(), HUD_Crosshair_Vehicle(), HUD_MinigameMenu_IsOpened(), intermission, max(), min(), MOVE_NORMAL, MOVE_WORLDONLY, MUTATOR_CALLHOOK, NULL, pickup_crosshair_size, pickup_crosshair_time, pointinsidebox, project_3d_to_2d(), scoreboard_active, SHOTTYPE_HITOBSTRUCTION, SHOTTYPE_HITTEAM, SHOTTYPE_HITWORLD, sin(), spectatee_status, stov(), strcat(), strfree, string_null, strunzone(), strzone(), time, trace_endpos, trace_ent, TrueAimCheck(), unaccounted_damage, use_vortex_chargepool, v, vdist, vec3, vector(), vid_conheight, vid_conwidth, view_forward, view_origin, VIEWLOC_FREEAIM, viewloc_mousepos, viewmodels, vortex_charge_movingavg, WarpZone_TraceLine(), wcross_alpha_goal_prev, wcross_alpha_prev, wcross_changedonetime, wcross_color_goal_prev, wcross_color_prev, wcross_name_alpha_goal_prev, wcross_name_alpha_goal_prev_prev, wcross_name_changedonetime, wcross_name_changestarttime, wcross_name_goal_prev, wcross_name_goal_prev_prev, wcross_origin, wcross_resolution_goal_prev, wcross_resolution_goal_prev_prev, wcross_ring_prev, wcross_scale_goal_prev, wcross_scale_prev, WEP_CVAR, and WEP_CVAR_SEC.

227 {
228  // reset player's alpha here upon death since forced scoreboard prevents running the crosshair_chase code
229  if(autocvar_chase_active > 0 && autocvar_crosshair_chase && STAT(HEALTH) <= 0 && csqcplayer)
230  csqcplayer.alpha = csqcplayer.m_alpha;
231 
233  {
234  if (csqcplayer.alpha != csqcplayer.m_alpha)
236  return;
237  }
238 
239  float f, i, j;
240  vector v;
241  if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && !autocvar_cl_lockview
242  && spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair)
244  {
245  if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
246  return;
247 
248  if (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2)
249  return;
250 
251  if (hud != HUD_NORMAL)
252  {
253  HUD_Crosshair_Vehicle(this);
254  return;
255  }
256 
257  string wcross_style;
258  float wcross_alpha, wcross_resolution;
259  wcross_style = autocvar_crosshair;
260  if (csqcplayer.viewloc && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM) && autocvar_crosshair_2d != "")
261  wcross_style = autocvar_crosshair_2d;
262  if (wcross_style == "0")
263  return;
264  wcross_resolution = autocvar_crosshair_size;
265  if (wcross_resolution == 0)
266  return;
267  wcross_alpha = autocvar_crosshair_alpha;
268  if (wcross_alpha == 0)
269  return;
270 
271  // TrueAim check
272  float shottype;
273 
274  static int crosshair_chase_state = 0;
275 
276  // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
277  if(csqcplayer.viewloc && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))
280  {
281  vector player_org = ((csqcplayer) ? csqcplayer.origin + csqcplayer.view_ofs : view_origin);
282  float my_alpha = (!csqcplayer.m_alpha) ? 1 : csqcplayer.m_alpha;
283  float chase_playeralpha = bound(0.001, autocvar_crosshair_chase_playeralpha, 1);
284  if(csqcplayer && chase_playeralpha < 1 && my_alpha > chase_playeralpha)
285  {
286  crosshair_chase_state = 2;
287  bool hit = false;
288  if (pointinsidebox(view_origin, csqcplayer.absmin, csqcplayer.absmax))
289  hit = true;
290  else
291  {
293  if(trace_ent == csqcplayer)
294  hit = true;
295  }
296  float prev_alpha = csqcplayer.alpha;
297  float new_alpha;
298  if(hit)
299  new_alpha = max(csqcplayer.alpha - frametime * 5, chase_playeralpha);
300  else
301  new_alpha = min(csqcplayer.alpha + frametime * 5, my_alpha);
302 
303  if (new_alpha != prev_alpha)
305  }
306  traceline(player_org, player_org + max_shot_distance * view_forward, MOVE_WORLDONLY, NULL);
308  }
309  else
310  wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
311  wcross_origin.z = 0;
312  if (crosshair_chase_state == 2) // enabled (this frame)
313  crosshair_chase_state = 1;
314  else if (crosshair_chase_state == 1) // turned off in the previous frame
315  {
316  // reset player alpha only in this frame
317  if (csqcplayer)
319  crosshair_chase_state = 0; // turned off and alpha reset
320  }
321 
323  {
324  vector wcross_oldorigin;
325  entity thiswep = viewmodels[0]; // TODO: unhardcode
326  wcross_oldorigin = wcross_origin;
327  shottype = TrueAimCheck(thiswep);
328  if(shottype == SHOTTYPE_HITWORLD)
329  {
330  v = wcross_origin - wcross_oldorigin;
331  v.x /= vid_conwidth;
332  v.y /= vid_conheight;
333  if(vdist(v, >, 0.01))
334  shottype = SHOTTYPE_HITOBSTRUCTION;
335  }
337  wcross_origin = wcross_oldorigin;
338  }
339  else
340  shottype = SHOTTYPE_HITWORLD;
341 
342  vector wcross_color = '0 0 0', wcross_size = '0 0 0';
343  string wcross_name = "";
344  float wcross_scale, wcross_blur;
345 
346  entity e = WEP_Null;
348  {
349  entity wepent = viewmodels[0]; // TODO: unhardcode
350  e = wepent.switchingweapon;
351  if(e)
352  {
354  {
355  // WEAPONTODO: access these through some general settings (with non-balance config settings)
356  //wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
357  //if (wcross_resolution == 0)
358  //return;
359 
360  //wcross_style = cvar_string(strcat("crosshair_", wcross_wep));
361  wcross_resolution *= e.w_crosshair_size;
362  wcross_name = e.w_crosshair;
363  }
364  }
365  }
366 
367  if(wcross_name == "")
368  wcross_name = strcat("gfx/crosshair", wcross_style);
369 
370  // MAIN CROSSHAIR COLOR DECISION
371  wcross_color = crosshair_getcolor(e, STAT(HEALTH));
372 
374  {
375  wcross_scale = wcross_resolution;
376  wcross_resolution = 1;
377  }
378  else
379  {
380  wcross_scale = 1;
381  }
382 
384  {
385  float stat_pickup_time = STAT(LAST_PICKUP);
386 
387  if(pickup_crosshair_time < stat_pickup_time)
388  {
389  if(time - stat_pickup_time < 5) // don't trigger the animation if it's too old
391 
392  pickup_crosshair_time = stat_pickup_time;
393  }
394 
395  if(pickup_crosshair_size > 0)
397  else
399 
401  }
402 
403  // todo: make crosshair hit indication dependent on damage dealt
405  {
407 
409  {
411  }
412 
415  else
417 
419  wcross_color.x += sin(hitindication_crosshair_size) * col.x;
420  wcross_color.y += sin(hitindication_crosshair_size) * col.y;
421  wcross_color.z += sin(hitindication_crosshair_size) * col.z;
422  }
423 
424  // no effects needed for targeting enemies, this can't possibly span all valid targets!
425  // just show for teammates to give a sign that they're an invalid target
426  //if(shottype == SHOTTYPE_HITENEMY)
427  //wcross_scale *= autocvar_crosshair_hittest; // is not queried if hittest is 0
428  if(shottype == SHOTTYPE_HITTEAM)
429  wcross_scale /= autocvar_crosshair_hittest; // is not queried if hittest is 0
430 
432  if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev)
433  {
435  }
436  if(wcross_name != wcross_name_goal_prev || wcross_resolution != wcross_resolution_goal_prev)
437  {
443  wcross_name_goal_prev = strzone(wcross_name);
446  wcross_resolution_goal_prev = wcross_resolution;
447  }
448 
449  wcross_scale_goal_prev = wcross_scale;
450  wcross_alpha_goal_prev = wcross_alpha;
451  wcross_color_goal_prev = wcross_color;
452 
455  {
456  wcross_blur = 1;
457  wcross_alpha *= 0.75;
458  }
459  else
460  wcross_blur = 0;
461  // *_prev is at time-frametime
462  // * is at wcross_changedonetime+f
463  // what do we have at time?
465  {
467  wcross_scale = f * wcross_scale + (1 - f) * wcross_scale_prev;
468  wcross_alpha = f * wcross_alpha + (1 - f) * wcross_alpha_prev;
469  wcross_color = f * wcross_color + (1 - f) * wcross_color_prev;
470  }
471 
472  wcross_scale_prev = wcross_scale;
473  wcross_alpha_prev = wcross_alpha;
474  wcross_color_prev = wcross_color;
475 
476  MUTATOR_CALLHOOK(UpdateCrosshair);
477 
478  wcross_scale *= 1 - autocvar__menu_alpha;
479  wcross_alpha *= 1 - autocvar__menu_alpha;
480  wcross_size = draw_getimagesize(wcross_name) * wcross_scale;
481 
482  if(wcross_scale >= 0.001 && wcross_alpha >= 0.001)
483  {
484  // crosshair rings for weapon stats
486  {
487  // declarations and stats
488  float ring_value = 0, ring_scale = 0, ring_alpha = 0, ring_inner_value = 0, ring_inner_alpha = 0;
489  string ring_image = string_null, ring_inner_image = string_null;
490  vector ring_rgb = '0 0 0', ring_inner_rgb = '0 0 0';
491 
492  ring_scale = autocvar_crosshair_ring_size;
493 
494  entity wepent = viewmodels[0]; // TODO: unhardcode
495 
496  int weapon_clipload = wepent.clip_load;
497  int weapon_clipsize = wepent.clip_size;
498 
499  float arc_heat = wepent.arc_heat_percent;
500 
501  if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
502  vortex_charge_movingavg = wepent.vortex_charge;
503 
504  float charge = 0;
505  float chargepool = 0;
506  bool ring_vortex_enabled = false;
508  {
509  if (wepent.activeweapon == WEP_VORTEX)
510  {
511  charge = wepent.vortex_charge;
512  chargepool = wepent.vortex_chargepool_ammo;
513  }
514  else if (wepent.activeweapon == WEP_OVERKILL_NEX)
515  {
516  charge = wepent.oknex_charge;
517  chargepool = wepent.oknex_chargepool_ammo;
518  }
519  if (charge)
520  ring_vortex_enabled = true;
521  }
522 
523  if (ring_vortex_enabled)
524  {
525  if (chargepool || use_vortex_chargepool) {
527  ring_inner_value = chargepool;
528  } else {
530  vortex_charge_movingavg = (1 - rate) * vortex_charge_movingavg + rate * charge;
532  }
533 
536  ring_inner_image = "gfx/crosshair_ring_inner";
537 
538  // draw the outer ring to show the current charge of the weapon
539  ring_value = charge;
541  ring_rgb = wcross_color;
542  ring_image = "gfx/crosshair_ring_nexgun";
543  }
544  else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
545  {
546  ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1);
548  ring_rgb = wcross_color;
549  ring_image = "gfx/crosshair_ring";
550  }
551  else if (wepent.activeweapon == WEP_HAGAR && wepent.hagar_load && autocvar_crosshair_ring_hagar)
552  {
553  ring_value = bound(0, wepent.hagar_load / WEP_CVAR_SEC(hagar, load_max), 1);
555  ring_rgb = wcross_color;
556  ring_image = "gfx/crosshair_ring";
557  }
558  else if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
559  {
560  ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
563  ring_rgb = wcross_color;
564 
565  // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances.
566  // if a new image for another weapon is added, add the code (and its respective file/value) here
567  if ((wepent.activeweapon == WEP_RIFLE) && (weapon_clipsize == 80))
568  ring_image = "gfx/crosshair_ring_rifle";
569  else
570  ring_image = "gfx/crosshair_ring";
571  }
572  else if ( autocvar_crosshair_ring && autocvar_crosshair_ring_arc && arc_heat && wepent.activeweapon == WEP_ARC )
573  {
574  ring_value = arc_heat;
575  ring_alpha = (1-arc_heat)*autocvar_crosshair_ring_arc_cold_alpha +
577  ring_rgb = (1-arc_heat)*wcross_color + arc_heat*autocvar_crosshair_ring_arc_hot_color;
578  ring_image = "gfx/crosshair_ring";
579  }
580 
581  // if in weapon switch animation, fade ring out/in
583  {
585  if (f >= 1)
586  {
587  wcross_ring_prev = ((ring_image) ? true : false);
588  }
589 
590  if(wcross_ring_prev)
591  {
592  if(f < 1)
593  ring_alpha *= fabs(1 - bound(0, f, 1));
594  }
595  else
596  {
597  if(f < 1)
598  ring_alpha *= bound(0, f, 1);
599  }
600  }
601 
602  if (autocvar_crosshair_ring_inner && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring
603  DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
604 
605  if (ring_value)
606  DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
607  }
608 
609 #define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
610  MACRO_BEGIN \
611  vector scaled_sz = sz * wcross_size; \
612  if(wcross_blur > 0) \
613  { \
614  for(i = -2; i <= 2; ++i) \
615  for(j = -2; j <= 2; ++j) \
616  M(i,j,sz,scaled_sz,wcross_name,wcross_alpha*0.04); \
617  } \
618  else \
619  { \
620  M(0,0,sz,scaled_sz,wcross_name,wcross_alpha); \
621  } \
622  MACRO_END
623 
624 #define CROSSHAIR_DRAW_SINGLE(i,j,sz,scaled_sz,wcross_name,wcross_alpha) \
625  drawpic(wcross_origin - ('0.5 0 0' * (scaled_sz.x + i * wcross_blur) + '0 0.5 0' * (scaled_sz.y + j * wcross_blur)), wcross_name, scaled_sz, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
626 
627 #define CROSSHAIR_DRAW(sz,wcross_name,wcross_alpha) \
628  CROSSHAIR_DO_BLUR(CROSSHAIR_DRAW_SINGLE,sz,wcross_name,wcross_alpha)
629 
631  {
633  wcross_size = draw_getimagesize(wcross_name_goal_prev_prev) * wcross_scale;
635  f = 1 - f;
636  }
637  else
638  {
639  f = 1;
640  }
642 
643  wcross_size = draw_getimagesize(wcross_name) * wcross_scale;
644  CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f);
645 
647  {
648  vector wcross_color_old;
649  wcross_color_old = wcross_color;
650 
652  wcross_color = stov(autocvar_crosshair_dot_color);
653 
654  CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot", f * autocvar_crosshair_dot_alpha);
655  // FIXME why don't we use wcross_alpha here?
656  wcross_color = wcross_color_old;
657  }
658  }
659  }
660  else
661  {
662  wcross_scale_prev = 0;
663  wcross_alpha_prev = 0;
675  }
676 }
float autocvar_crosshair_ring_vortex_inner_color_blue
Definition: crosshair.qh:45
float vid_conheight
float pickup_crosshair_time
Definition: crosshair.qc:18
#define WEP_CVAR_SEC(wepname, name)
Definition: all.qh:301
string string_null
Definition: nil.qh:9
bool autocvar_crosshair_ring_inner
Definition: crosshair.qh:35
float pickup_crosshair_size
Definition: crosshair.qc:18
bool autocvar_crosshair_hittest_blur_teammate
Definition: crosshair.qh:28
void HUD_Crosshair_ApplyPlayerAlpha(float new_alpha)
Definition: crosshair.qc:217
vector project_3d_to_2d(vector vec)
Definition: view.qc:359
float wcross_alpha_prev
Definition: crosshair.qc:25
bool autocvar_crosshair_hittest
Definition: crosshair.qh:27
float wcross_changedonetime
Definition: crosshair.qc:29
float autocvar_crosshair_ring_vortex_alpha
Definition: crosshair.qh:41
bool HUD_MinigameMenu_IsOpened()
bool autocvar_crosshair_ring
Definition: crosshair.qh:34
float autocvar_crosshair_alpha
Definition: crosshair.qh:10
float TrueAimCheck(entity wepent)
Definition: crosshair.qc:74
float autocvar_crosshair_dot_size
Definition: crosshair.qh:19
bool scoreboard_active
Definition: scoreboard.qh:9
entity viewmodels[MAX_WEAPONSLOTS]
Definition: view.qh:104
vector wcross_color_prev
Definition: crosshair.qc:26
bool autocvar_crosshair_hittest_blur_wall
Definition: crosshair.qh:29
entity() spawn
#define vec3(_x, _y, _z)
Definition: vector.qh:95
const float MOVE_NORMAL
Definition: csprogsdefs.qc:252
bool autocvar_crosshair_hitindication
Definition: crosshair.qh:23
vector view_origin
Definition: main.qh:93
float intermission
Definition: csprogsdefs.qc:148
float autocvar_crosshair_pickup_speed
Definition: crosshair.qh:33
float wcross_name_changedonetime
Definition: crosshair.qc:33
void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector rgb, float a, float drawflag)
Definition: draw.qc:182
float use_vortex_chargepool
Definition: crosshair.qc:20
float wcross_scale_prev
Definition: crosshair.qc:25
string autocvar_crosshair_dot_color
Definition: crosshair.qh:17
vector autocvar_crosshair_ring_arc_hot_color
Definition: crosshair.qh:49
float autocvar_crosshair_effect_time
Definition: crosshair.qh:21
#define WEP_CVAR(wepname, name)
Definition: all.qh:299
const int VIEWLOC_FREEAIM
Definition: viewloc.qh:5
float wcross_scale_goal_prev
Definition: crosshair.qc:27
float vortex_charge_movingavg
Definition: crosshair.qh:60
vector view_forward
Definition: main.qh:93
bool autocvar_crosshair_effect_scalefade
Definition: crosshair.qh:20
float vid_conwidth
vector wcross_origin
Definition: crosshair.qc:24
bool autocvar_crosshair_ring_minelayer
Definition: crosshair.qh:36
float wcross_resolution_goal_prev_prev
Definition: crosshair.qc:32
float autocvar_crosshair_size
Definition: crosshair.qh:56
float autocvar_crosshair_dot_alpha
Definition: crosshair.qh:16
bool autocvar_cl_lockview
Definition: view.qh:20
entity trace_ent
Definition: csprogsdefs.qc:40
bool autocvar_crosshair_ring_arc
Definition: crosshair.qh:48
vector wcross_color_goal_prev
Definition: crosshair.qc:28
bool autocvar_chase_front
Definition: view.qh:18
const float DRAWFLAG_ADDITIVE
Definition: csprogsdefs.qc:318
float autocvar__menu_alpha
Definition: hud.qh:184
float autocvar_crosshair_ring_arc_hot_alpha
Definition: crosshair.qh:51
void HUD_Crosshair_Vehicle(entity this)
Definition: crosshair.qc:165
#define CROSSHAIR_DRAW(sz, wcross_name, wcross_alpha)
float autocvar_crosshair_ring_hagar_alpha
Definition: crosshair.qh:39
vector viewloc_mousepos
Definition: view.qh:106
string autocvar_crosshair
Definition: crosshair.qh:8
float autocvar_crosshair_ring_vortex_inner_color_red
Definition: crosshair.qh:47
float wcross_name_changestarttime
Definition: crosshair.qc:33
string autocvar_crosshair_hitindication_color
Definition: crosshair.qh:24
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"))
float wcross_ring_prev
Definition: crosshair.qc:36
string wcross_name_goal_prev
Definition: crosshair.qc:31
float autocvar_crosshair_ring_arc_cold_alpha
Definition: crosshair.qh:50
float autocvar_crosshair_ring_minelayer_alpha
Definition: crosshair.qh:37
float autocvar_crosshair_ring_size
Definition: crosshair.qh:52
#define pointinsidebox(point, bmins, bmaxs)
Definition: vector.qh:79
#define NULL
Definition: post.qh:17
string autocvar_crosshair_hitindication_per_weapon_color
Definition: crosshair.qh:25
float frametime
Definition: csprogsdefs.qc:17
float wcross_alpha_goal_prev
Definition: crosshair.qc:27
vector trace_endpos
Definition: csprogsdefs.qc:37
float wcross_name_alpha_goal_prev_prev
Definition: crosshair.qc:34
string autocvar_crosshair_2d
Definition: crosshair.qh:9
bool autocvar_crosshair_chase
Definition: crosshair.qh:57
float wcross_resolution_goal_prev
Definition: crosshair.qc:32
bool autocvar_crosshair_per_weapon
Definition: crosshair.qh:31
float autocvar_crosshair_ring_vortex_inner_color_green
Definition: crosshair.qh:46
vector(float skel, float bonenum) _skel_get_boneabs_hidden
bool autocvar_crosshair_dot
Definition: crosshair.qh:15
vector crosshair_getcolor(entity this, float health_stat)
Definition: crosshair.qc:174
const float SHOTTYPE_HITOBSTRUCTION
Definition: crosshair.qc:42
vector v
Definition: ent_cs.qc:116
float spectatee_status
Definition: main.qh:166
float camera_active
Definition: main.qh:123
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition: vector.qh:8
bool autocvar_crosshair_ring_hagar
Definition: crosshair.qh:38
float unaccounted_damage
Definition: view.qh:116
bool autocvar_crosshair_ring_reload
Definition: crosshair.qh:53
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
Definition: common.qc:338
float autocvar_crosshair_ring_reload_size
Definition: crosshair.qh:55
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
bool autocvar_crosshair_dot_color_custom
Definition: crosshair.qh:18
const float SHOTTYPE_HITTEAM
Definition: crosshair.qc:41
float autocvar_crosshair_chase_playeralpha
Definition: crosshair.qh:58
bool autocvar_crosshair_ring_vortex
Definition: crosshair.qh:40
#define strfree(this)
Definition: string.qh:56
float autocvar_crosshair_pickup
Definition: crosshair.qh:32
float autocvar_crosshair_ring_vortex_currentcharge_scale
Definition: crosshair.qh:43
bool autocvar_crosshair_enabled
Definition: crosshair.qh:22
entity csqcplayer
Definition: cl_player.qh:26
int autocvar_chase_active
Definition: view.qh:17
float wcross_name_alpha_goal_prev
Definition: crosshair.qc:34
float MOVE_WORLDONLY
float time
Definition: csprogsdefs.qc:16
int autocvar_crosshair_color_special
Definition: crosshair.qh:12
float autocvar_crosshair_ring_vortex_inner_alpha
Definition: crosshair.qh:44
bool autocvar_crosshair_hittest_showimpact
Definition: crosshair.qh:30
float autocvar_crosshair_hitindication_speed
Definition: crosshair.qh:26
float autocvar_crosshair_ring_reload_alpha
Definition: crosshair.qh:54
float hitindication_crosshair_size
Definition: crosshair.qc:19
string wcross_name_goal_prev_prev
Definition: crosshair.qc:31
int hud
Definition: main.qh:142
const float SHOTTYPE_HITWORLD
Definition: crosshair.qc:43
float autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate
Definition: crosshair.qh:42
+ Here is the call graph for this function:

◆ HUD_Crosshair_ApplyPlayerAlpha()

void HUD_Crosshair_ApplyPlayerAlpha ( float  new_alpha)

Definition at line 217 of file crosshair.qc.

References csqcplayer, and FOREACH_ENTITY_CLASS.

Referenced by HUD_Crosshair().

218 {
219  csqcplayer.alpha = new_alpha;
220  FOREACH_ENTITY_CLASS("ENT_CLIENT_MODEL", it.tag_entity == csqcplayer,
221  {
222  it.alpha = new_alpha;
223  });
224 }
#define FOREACH_ENTITY_CLASS(class, cond, body)
Definition: iter.qh:189
entity csqcplayer
Definition: cl_player.qh:26
+ Here is the caller graph for this function:

◆ HUD_Crosshair_Vehicle()

void HUD_Crosshair_Vehicle ( entity  this)

Definition at line 165 of file crosshair.qc.

References hud, and REGISTRY_GET.

Referenced by HUD_Crosshair().

166 {
167  if(hud != HUD_BUMBLEBEE_GUN)
168  {
169  Vehicle info = REGISTRY_GET(Vehicles, hud);
170  info.vr_crosshair(info, this);
171  }
172 }
#define REGISTRY_GET(id, i)
Definition: registry.qh:43
int hud
Definition: main.qh:142
+ Here is the caller graph for this function:

◆ TrueAim_Init()

void TrueAim_Init ( )

Definition at line 46 of file crosshair.qc.

References DPCONTENTS_BODY, DPCONTENTS_CORPSE, DPCONTENTS_SOLID, dphitcontentsmask, new_pure, trueaim, and trueaim_rifle.

Referenced by PostInit().

47 {
50 }
float DPCONTENTS_SOLID
entity trueaim_rifle
Definition: crosshair.qc:39
float DPCONTENTS_BODY
#define new_pure(class)
purely logical entities (.origin doesn&#39;t work)
Definition: oo.qh:62
float dphitcontentsmask
entity trueaim
Definition: crosshair.qc:38
float DPCONTENTS_CORPSE
+ Here is the caller graph for this function:

◆ TrueAimCheck()

float TrueAimCheck ( entity  wepent)

Definition at line 74 of file crosshair.qc.

References decompressShotOrigin(), EnemyHitCheck(), entity(), eZ, g_trueaim_minrange, MOVE_NOMONSTERS, MOVE_NORMAL, player_localentnum, SHOTTYPE_HITOBSTRUCTION, SHOTTYPE_HITWORLD, trace_endpos, trueaim, trueaim_rifle, vdist, vector(), view_forward, view_origin, view_right, view_up, vlen(), w_shotorg, WEP_FLAG_NOTRUEAIM, and zoomscript_caught.

Referenced by HUD_Crosshair().

75 {
76  if(wepent.activeweapon.spawnflags & WEP_FLAG_NOTRUEAIM)
77  return SHOTTYPE_HITWORLD;
78 
79  float nudge = 1; // added to traceline target and subtracted from result TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
80  vector vecs, trueaimpoint, w_shotorg;
81  vector mi, ma, dv;
82  float shottype;
83  entity ta;
84  float mv;
85 
86  mi = ma = '0 0 0';
87  ta = trueaim;
88  mv = MOVE_NOMONSTERS;
89 
90  switch(wepent.activeweapon) // WEAPONTODO
91  {
92  case WEP_VORTEX:
93  case WEP_OVERKILL_NEX:
94  case WEP_VAPORIZER:
95  mv = MOVE_NORMAL;
96  break;
97  case WEP_RIFLE:
98  ta = trueaim_rifle;
99  mv = MOVE_NORMAL;
101  {
102  tracebox(view_origin, '0 0 0', '0 0 0', view_origin + view_forward * max_shot_distance, mv, ta);
103  return EnemyHitCheck();
104  }
105  break;
106  case WEP_DEVASTATOR: // projectile has a size!
107  mi = '-3 -3 -3';
108  ma = '3 3 3';
109  break;
110  case WEP_FIREBALL: // projectile has a size!
111  mi = '-16 -16 -16';
112  ma = '16 16 16';
113  break;
114  case WEP_SEEKER: // projectile has a size!
115  mi = '-2 -2 -2';
116  ma = '2 2 2';
117  break;
118  case WEP_ELECTRO: // projectile has a size!
119  mi = '0 0 -3';
120  ma = '0 0 -3';
121  break;
122  }
123 
124  vector traceorigin = entcs_receiver(player_localentnum - 1).origin + (eZ * STAT(VIEWHEIGHT));
125 
126  vecs = decompressShotOrigin(STAT(SHOTORG));
127 
128  traceline(traceorigin, traceorigin + view_forward * max_shot_distance, mv, ta);
129  trueaimpoint = trace_endpos;
130  // move trueaimpoint a little bit forward to make the final tracebox reliable
131  // since it sometimes doesn't reach a teammate by a hair
132  trueaimpoint += view_forward;
133 
134  if(vdist((trueaimpoint - traceorigin), <, g_trueaim_minrange))
135  trueaimpoint = traceorigin + view_forward * g_trueaim_minrange;
136 
137  if(vecs.x > 0)
138  vecs.y = -vecs.y;
139  else
140  vecs = '0 0 0';
141 
142  dv = view_right * vecs.y + view_up * vecs.z;
143  w_shotorg = traceorigin + dv;
144 
145  // now move the vecs forward as much as requested if possible
146  tracebox(w_shotorg, mi, ma, w_shotorg + view_forward * (vecs.x + nudge), MOVE_NORMAL, ta); // FIXME this MOVE_NORMAL part will misbehave a little in csqc
147  w_shotorg = trace_endpos - view_forward * nudge;
148 
149  tracebox(w_shotorg, mi, ma, trueaimpoint, MOVE_NORMAL, ta);
150  shottype = EnemyHitCheck();
151  if(shottype != SHOTTYPE_HITWORLD)
152  return shottype;
153 
154 #if 0
155  // FIXME WHY DOES THIS NOT WORK FOR THE ROCKET LAUNCHER?
156  // or rather, I know why, but see no fix
157  if(vlen(trace_endpos - trueaimpoint) > vlen(ma) + vlen(mi) + 1)
158  // yes, this is an ugly hack... but it seems good enough to find out whether the test hits the same place as the initial trace
160 #endif
161 
162  return SHOTTYPE_HITWORLD;
163 }
vector w_shotorg
Definition: tracing.qh:18
float zoomscript_caught
Definition: view.qh:117
entity() spawn
const float MOVE_NORMAL
Definition: csprogsdefs.qc:252
vector view_origin
Definition: main.qh:93
vector view_forward
Definition: main.qh:93
vector decompressShotOrigin(int f)
Definition: util.qc:1143
vector view_up
Definition: main.qh:93
const float MOVE_NOMONSTERS
Definition: csprogsdefs.qc:253
vector trace_endpos
Definition: csprogsdefs.qc:37
vector view_right
Definition: main.qh:93
float player_localentnum
Definition: csprogsdefs.qc:19
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity trueaim_rifle
Definition: crosshair.qc:39
const float SHOTTYPE_HITOBSTRUCTION
Definition: crosshair.qc:42
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition: vector.qh:8
const vector eZ
Definition: vector.qh:46
const int WEP_FLAG_NOTRUEAIM
Definition: weapon.qh:210
float EnemyHitCheck()
Definition: crosshair.qc:52
entity trueaim
Definition: crosshair.qc:38
float g_trueaim_minrange
Definition: main.qh:140
const float SHOTTYPE_HITWORLD
Definition: crosshair.qc:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ hitindication_crosshair_size

float hitindication_crosshair_size

Definition at line 19 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ pickup_crosshair_size

float pickup_crosshair_size

Definition at line 18 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ pickup_crosshair_time

float pickup_crosshair_time

Definition at line 18 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ reticle_type

float reticle_type

Definition at line 22 of file crosshair.qc.

Referenced by DrawReticle().

◆ SHOTTYPE_HITENEMY

const float SHOTTYPE_HITENEMY = 4

Definition at line 44 of file crosshair.qc.

Referenced by EnemyHitCheck().

◆ SHOTTYPE_HITOBSTRUCTION

const float SHOTTYPE_HITOBSTRUCTION = 2

Definition at line 42 of file crosshair.qc.

Referenced by HUD_Crosshair(), and TrueAimCheck().

◆ SHOTTYPE_HITTEAM

const float SHOTTYPE_HITTEAM = 1

Definition at line 41 of file crosshair.qc.

Referenced by EnemyHitCheck(), and HUD_Crosshair().

◆ SHOTTYPE_HITWORLD

const float SHOTTYPE_HITWORLD = 3

Definition at line 43 of file crosshair.qc.

Referenced by EnemyHitCheck(), HUD_Crosshair(), and TrueAimCheck().

◆ tag_entity

entity tag_entity

Definition at line 216 of file crosshair.qc.

◆ trueaim

entity trueaim

Definition at line 38 of file crosshair.qc.

Referenced by TrueAim_Init(), and TrueAimCheck().

◆ trueaim_rifle

entity trueaim_rifle

Definition at line 39 of file crosshair.qc.

Referenced by TrueAim_Init(), and TrueAimCheck().

◆ use_vortex_chargepool

float use_vortex_chargepool

Definition at line 20 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_alpha_goal_prev

float wcross_alpha_goal_prev

Definition at line 27 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_alpha_prev

float wcross_alpha_prev

Definition at line 25 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_changedonetime

float wcross_changedonetime

Definition at line 29 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_color_goal_prev

vector wcross_color_goal_prev

Definition at line 28 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_color_prev

vector wcross_color_prev

Definition at line 26 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_name_alpha_goal_prev

float wcross_name_alpha_goal_prev

Definition at line 34 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_name_alpha_goal_prev_prev

float wcross_name_alpha_goal_prev_prev

Definition at line 34 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_name_changedonetime

float wcross_name_changedonetime

Definition at line 33 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_name_changestarttime

float wcross_name_changestarttime

Definition at line 33 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_name_goal_prev

string wcross_name_goal_prev

Definition at line 31 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_name_goal_prev_prev

string wcross_name_goal_prev_prev

Definition at line 31 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_origin

vector wcross_origin

Definition at line 24 of file crosshair.qc.

Referenced by EnemyHitCheck(), and HUD_Crosshair().

◆ wcross_resolution_goal_prev

float wcross_resolution_goal_prev

Definition at line 32 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_resolution_goal_prev_prev

float wcross_resolution_goal_prev_prev

Definition at line 32 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_ring_prev

float wcross_ring_prev

Definition at line 36 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_scale_goal_prev

float wcross_scale_goal_prev

Definition at line 27 of file crosshair.qc.

Referenced by HUD_Crosshair().

◆ wcross_scale_prev

float wcross_scale_prev

Definition at line 25 of file crosshair.qc.

Referenced by HUD_Crosshair().