Quake II RTX doxygen  1.0 dev
effects.c File Reference
#include "client.h"

Go to the source code of this file.

Macros

#define DL_COLOR(r, g, b)
 
#define DL_RADIUS(r)
 
#define DL_DIE(t)
 
#define BEAMLENGTH   16
 

Functions

static void CL_LogoutEffect (vec3_t org, int type)
 
void CL_MuzzleFlash (void)
 
void CL_MuzzleFlash2 (void)
 
void FX_Init (void)
 
static void CL_ClearParticles (void)
 
cparticle_tCL_AllocParticle (void)
 
void CL_ParticleEffect (vec3_t org, vec3_t dir, int color, int count)
 
void CL_ParticleEffectWaterSplash (vec3_t org, vec3_t dir, int color, int count)
 
void CL_BloodParticleEffect (vec3_t org, vec3_t dir, int color, int count)
 
void CL_ParticleEffect2 (vec3_t org, vec3_t dir, int color, int count)
 
void CL_TeleporterParticles (vec3_t org)
 
void CL_ItemRespawnParticles (vec3_t org)
 
void CL_ExplosionParticles (vec3_t org)
 
void CL_BigTeleportParticles (vec3_t org)
 
void CL_BlasterParticles (vec3_t org, vec3_t dir)
 
void CL_BlasterTrail (vec3_t start, vec3_t end)
 
void CL_QuadTrail (vec3_t start, vec3_t end)
 
void CL_FlagTrail (vec3_t start, vec3_t end, int color)
 
void CL_DiminishingTrail (vec3_t start, vec3_t end, centity_t *old, int flags)
 
void CL_RocketTrail (vec3_t start, vec3_t end, centity_t *old)
 
void CL_OldRailTrail (void)
 
void CL_BubbleTrail (vec3_t start, vec3_t end)
 
static void CL_FlyParticles (vec3_t origin, int count)
 
void CL_FlyEffect (centity_t *ent, vec3_t origin)
 
void CL_BfgParticles (entity_t *ent)
 
void CL_BFGExplosionParticles (vec3_t org)
 
void CL_TeleportParticles (vec3_t org)
 
void CL_AddParticles (void)
 
void CL_ClearEffects (void)
 
void CL_InitEffects (void)
 

Variables

static vec3_t avelocities [NUMVERTEXNORMALS]
 
static cparticle_tactive_particles
 
static cparticle_tfree_particles
 
static cparticle_t particles [MAX_PARTICLES]
 
static const int cl_numparticles = MAX_PARTICLES
 
uint32_t d_8to24table [256]
 
cvar_t * cvar_pt_particle_emissive = NULL
 
static cvar_t * cl_particle_num_factor = NULL
 
int r_numparticles
 
particle_t r_particles [MAX_PARTICLES]
 

Macro Definition Documentation

◆ BEAMLENGTH

#define BEAMLENGTH   16

Definition at line 1765 of file effects.c.

◆ DL_COLOR

#define DL_COLOR (   r,
  g,
 
)

◆ DL_DIE

#define DL_DIE (   t)

◆ DL_RADIUS

#define DL_RADIUS (   r)

Function Documentation

◆ CL_AddParticles()

void CL_AddParticles ( void  )

Definition at line 1989 of file effects.c.

1990 {
1991  cparticle_t *p, *next;
1992  float alpha;
1993  float time = 0, time2;
1994  int color;
1995  cparticle_t *active, *tail;
1996  particle_t *part;
1997 
1998  active = NULL;
1999  tail = NULL;
2000 
2001  for (p = active_particles; p; p = next) {
2002  next = p->next;
2003 
2004  if (p->alphavel != INSTANT_PARTICLE) {
2005  time = (cl.time - p->time) * 0.001;
2006  alpha = p->alpha + time * p->alphavel;
2007  if (alpha <= 0) {
2008  // faded out
2009  p->next = free_particles;
2010  free_particles = p;
2011  continue;
2012  }
2013  } else {
2014  alpha = p->alpha;
2015  }
2016 
2017  if (r_numparticles >= MAX_PARTICLES)
2018  break;
2019  part = &r_particles[r_numparticles++];
2020 
2021  p->next = NULL;
2022  if (!tail)
2023  active = tail = p;
2024  else {
2025  tail->next = p;
2026  tail = p;
2027  }
2028 
2029  if (alpha > 1.0)
2030  alpha = 1;
2031  color = p->color;
2032 
2033  time2 = time * time;
2034 
2035  part->origin[0] = p->org[0] + p->vel[0] * time + p->accel[0] * time2;
2036  part->origin[1] = p->org[1] + p->vel[1] * time + p->accel[1] * time2;
2037  part->origin[2] = p->org[2] + p->vel[2] * time + p->accel[2] * time2;
2038 
2039  if (color == -1) {
2040  part->rgba.u8[0] = p->rgba.u8[0];
2041  part->rgba.u8[1] = p->rgba.u8[1];
2042  part->rgba.u8[2] = p->rgba.u8[2];
2043  part->rgba.u8[3] = p->rgba.u8[3] * alpha;
2044  }
2045 
2046  part->color = color;
2047  part->brightness = p->brightness;
2048  part->alpha = alpha;
2049  part->radius = 0.f;
2050 
2051  if (p->alphavel == INSTANT_PARTICLE) {
2052  p->alphavel = 0.0;
2053  p->alpha = 0.0;
2054  }
2055  }
2056 
2057  active_particles = active;
2058 }

Referenced by CL_AddEntities().

◆ CL_AllocParticle()

◆ CL_BFGExplosionParticles()

void CL_BFGExplosionParticles ( vec3_t  org)

Definition at line 1905 of file effects.c.

1906 {
1907  int i, j;
1908  cparticle_t *p;
1909 
1910  const int count = 256 * cl_particle_num_factor->value;
1911 
1912  for (i = 0; i < count; i++) {
1913  p = CL_AllocParticle();
1914  if (!p)
1915  return;
1916 
1917  p->time = cl.time;
1918 
1919  p->color = 0xd0 + (rand() & 7);
1921 
1922  for (j = 0; j < 3; j++) {
1923  p->org[j] = org[j] + ((rand() % 32) - 16);
1924  p->vel[j] = (rand() % 384) - 192;
1925  }
1926 
1927  p->accel[0] = p->accel[1] = 0;
1928  p->accel[2] = -PARTICLE_GRAVITY;
1929  p->alpha = 1.0;
1930 
1931  p->alphavel = -0.8 / (0.5 + frand() * 0.3);
1932  }
1933 }

Referenced by CL_ParseTEnt().

◆ CL_BfgParticles()

void CL_BfgParticles ( entity_t *  ent)

Definition at line 1847 of file effects.c.

1848 {
1849  int i;
1850  cparticle_t *p;
1851  float angle;
1852  float sp, sy, cp, cy;
1853  vec3_t forward;
1854  float dist = 64;
1855  vec3_t v;
1856  float ltime;
1857 
1858  const int count = NUMVERTEXNORMALS * cl_particle_num_factor->value;
1859 
1860  ltime = (float)cl.time / 1000.0;
1861  for (i = 0; i < count; i++) {
1862  angle = ltime * avelocities[i][0];
1863  sy = sin(angle);
1864  cy = cos(angle);
1865  angle = ltime * avelocities[i][1];
1866  sp = sin(angle);
1867  cp = cos(angle);
1868 
1869  forward[0] = cp * cy;
1870  forward[1] = cp * sy;
1871  forward[2] = -sp;
1872 
1873  p = CL_AllocParticle();
1874  if (!p)
1875  return;
1876 
1877  p->time = cl.time;
1878 
1879  dist = sin(ltime + i) * 64;
1880  p->org[0] = ent->origin[0] + bytedirs[i][0] * dist + forward[0] * BEAMLENGTH;
1881  p->org[1] = ent->origin[1] + bytedirs[i][1] * dist + forward[1] * BEAMLENGTH;
1882  p->org[2] = ent->origin[2] + bytedirs[i][2] * dist + forward[2] * BEAMLENGTH;
1883 
1884  VectorClear(p->vel);
1885  VectorClear(p->accel);
1886 
1887  VectorSubtract(p->org, ent->origin, v);
1888  dist = VectorLength(v) / 90.0;
1889 
1890  p->color = floor(0xd0 + dist * 7);
1892 
1893  p->alpha = 1.0 - dist;
1895  }
1896 }

Referenced by CL_AddPacketEntities().

◆ CL_BigTeleportParticles()

void CL_BigTeleportParticles ( vec3_t  org)

Definition at line 1256 of file effects.c.

1257 {
1258  static const byte colortable[4] = {2 * 8, 13 * 8, 21 * 8, 18 * 8};
1259  int i;
1260  cparticle_t *p;
1261  float angle, dist;
1262 
1263  for (i = 0; i < 4096; i++) {
1264  p = CL_AllocParticle();
1265  if (!p)
1266  return;
1267 
1268  p->time = cl.time;
1269 
1270  p->color = colortable[rand() & 3];
1271  p->brightness = 1.0f;
1272 
1273  angle = M_PI * 2 * (rand() & 1023) / 1023.0;
1274  dist = rand() & 31;
1275  p->org[0] = org[0] + cos(angle) * dist;
1276  p->vel[0] = cos(angle) * (70 + (rand() & 63));
1277  p->accel[0] = -cos(angle) * 100;
1278 
1279  p->org[1] = org[1] + sin(angle) * dist;
1280  p->vel[1] = sin(angle) * (70 + (rand() & 63));
1281  p->accel[1] = -sin(angle) * 100;
1282 
1283  p->org[2] = org[2] + 8 + (rand() % 90);
1284  p->vel[2] = -100 + (rand() & 31);
1285  p->accel[2] = PARTICLE_GRAVITY * 4;
1286  p->alpha = 1.0;
1287 
1288  p->alphavel = -0.3 / (0.5 + frand() * 0.3);
1289  }
1290 }

Referenced by CL_ParseTEnt().

◆ CL_BlasterParticles()

void CL_BlasterParticles ( vec3_t  org,
vec3_t  dir 
)

Definition at line 1300 of file effects.c.

1301 {
1302  int i, j;
1303  cparticle_t *p;
1304  float d;
1305 
1306  const int count = 40 * cl_particle_num_factor->value;
1307 
1308  for (i = 0; i < count; i++) {
1309  p = CL_AllocParticle();
1310  if (!p)
1311  return;
1312 
1313  p->time = cl.time;
1314 
1315  p->color = 0xe0 + (rand() & 7);
1317 
1318  d = rand() & 15;
1319  for (j = 0; j < 3; j++) {
1320  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
1321  p->vel[j] = dir[j] * 30 + crand() * 40;
1322  }
1323 
1324  p->accel[0] = p->accel[1] = 0;
1325  p->accel[2] = -PARTICLE_GRAVITY;
1326  p->alpha = 1.0;
1327 
1328  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1329  }
1330 }

Referenced by CL_ParseTEnt().

◆ CL_BlasterTrail()

void CL_BlasterTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 1339 of file effects.c.

1340 {
1341  vec3_t move;
1342  vec3_t vec;
1343  float len;
1344  int j;
1345  cparticle_t *p;
1346  int dec;
1347 
1348  VectorCopy(start, move);
1349  VectorSubtract(end, start, vec);
1350  len = VectorNormalize(vec);
1351 
1352  dec = 5;
1353  VectorScale(vec, 5, vec);
1354 
1355  // FIXME: this is a really silly way to have a loop
1356  while (len > 0) {
1357  len -= dec;
1358 
1359  p = CL_AllocParticle();
1360  if (!p)
1361  return;
1362  VectorClear(p->accel);
1363 
1364  p->time = cl.time;
1365 
1366  p->alpha = 1.0;
1367  p->alphavel = -1.0 / (0.3 + frand() * 0.2);
1368 
1369  p->color = 0xe0;
1371 
1372  for (j = 0; j < 3; j++) {
1373  p->org[j] = move[j] + crand();
1374  p->vel[j] = crand() * 5;
1375  p->accel[j] = 0;
1376  }
1377 
1378  VectorAdd(move, vec, move);
1379  }
1380 }

Referenced by CL_AddPacketEntities().

◆ CL_BloodParticleEffect()

void CL_BloodParticleEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 1006 of file effects.c.

1007 {
1008  int i, j;
1009  cparticle_t *p;
1010  float d;
1011 
1012  // add decal:
1013  decal_t dec = {
1014  .pos = {org[0],org[1],org[2]},
1015  .dir = {dir[0],dir[1],dir[2]},
1016  .spread = 0.25f,
1017  .length = 350};
1018  R_AddDecal(&dec);
1019 
1020  float a[3] = {dir[1], -dir[2], dir[0]};
1021  float b[3] = {-dir[2], dir[0], dir[1]};
1022 
1023  count *= cl_particle_num_factor->value;
1024 
1025  for (i = 0; i < count; i++) {
1026  p = CL_AllocParticle();
1027  if (!p)
1028  return;
1029 
1030  p->time = cl.time;
1031 
1032  p->color = color + (rand() & 7);
1033  p->brightness = 0.5f;
1034 
1035  d = (rand() & 31) * 10.0f;
1036  for (j = 0; j < 3; j++) {
1037  p->org[j] = org[j] + ((rand() & 7) - 4) + d * (dir[j]
1038  + a[j] * 0.5f*((rand() & 31) / 32.0f - .5f)
1039  + b[j] * 0.5f*((rand() & 31) / 32.0f - .5f));
1040 
1041  p->vel[j] = 10.0f*dir[j] + crand() * 20;
1042  }
1043  // fake gravity
1044  p->org[2] -= d*d * .001f;
1045 
1046  p->accel[0] = p->accel[1] = 0;
1047  p->accel[2] = -PARTICLE_GRAVITY;
1048  p->alpha = 0.5;
1049 
1050  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1051  }
1052 }

Referenced by CL_ParseTEnt().

◆ CL_BubbleTrail()

void CL_BubbleTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 1718 of file effects.c.

1719 {
1720  vec3_t move;
1721  vec3_t vec;
1722  float len;
1723  int i, j;
1724  cparticle_t *p;
1725  float dec;
1726 
1727  VectorCopy(start, move);
1728  VectorSubtract(end, start, vec);
1729  len = VectorNormalize(vec);
1730 
1731  dec = 32;
1732  VectorScale(vec, dec, vec);
1733 
1734  for (i = 0; i < len; i += dec) {
1735  p = CL_AllocParticle();
1736  if (!p)
1737  return;
1738 
1739  VectorClear(p->accel);
1740  p->time = cl.time;
1741 
1742  p->alpha = 1.0;
1743  p->alphavel = -1.0 / (1 + frand() * 0.2);
1744 
1745  p->color = 4 + (rand() & 7);
1746  p->brightness = 1.0f;
1747 
1748  for (j = 0; j < 3; j++) {
1749  p->org[j] = move[j] + crand() * 2;
1750  p->vel[j] = crand() * 5;
1751  }
1752  p->vel[2] += 6;
1753 
1754  VectorAdd(move, vec, move);
1755  }
1756 }

Referenced by CL_ParseTEnt().

◆ CL_ClearEffects()

void CL_ClearEffects ( void  )

Definition at line 2067 of file effects.c.

2068 {
2070 #if USE_DLIGHTS
2071  CL_ClearDlights();
2072 #endif
2073 }

Referenced by CL_ClearState(), and CL_Seek_f().

◆ CL_ClearParticles()

static void CL_ClearParticles ( void  )
static

Definition at line 844 of file effects.c.

845 {
846  int i;
847 
849  active_particles = NULL;
850 
851  for (i = 0; i < cl_numparticles; i++)
852  particles[i].next = &particles[i + 1];
853  particles[cl_numparticles - 1].next = NULL;
854 }

Referenced by CL_ClearEffects().

◆ CL_DiminishingTrail()

void CL_DiminishingTrail ( vec3_t  start,
vec3_t  end,
centity_t old,
int  flags 
)

Definition at line 1484 of file effects.c.

1485 {
1486  vec3_t move;
1487  vec3_t vec;
1488  float len;
1489  int j;
1490  cparticle_t *p;
1491  float dec;
1492  float orgscale;
1493  float velscale;
1494 
1495  VectorCopy(start, move);
1496  VectorSubtract(end, start, vec);
1497  len = VectorNormalize(vec);
1498 
1499  dec = 0.5;
1500  VectorScale(vec, dec, vec);
1501 
1502  if (old->trailcount > 900) {
1503  orgscale = 4;
1504  velscale = 15;
1505  } else if (old->trailcount > 800) {
1506  orgscale = 2;
1507  velscale = 10;
1508  } else {
1509  orgscale = 1;
1510  velscale = 5;
1511  }
1512 
1513  while (len > 0) {
1514  len -= dec;
1515 
1516  // drop less particles as it flies
1517  if ((rand() & 1023) < old->trailcount) {
1518  p = CL_AllocParticle();
1519  if (!p)
1520  return;
1521  VectorClear(p->accel);
1522 
1523  p->time = cl.time;
1524 
1525  if (flags & EF_GIB) {
1526  p->alpha = 1.0;
1527  p->alphavel = -1.0 / (1 + frand() * 0.4);
1528 
1529  p->color = 0xe8 + (rand() & 7);
1530  p->brightness = 1.0f;
1531 
1532  for (j = 0; j < 3; j++) {
1533  p->org[j] = move[j] + crand() * orgscale;
1534  p->vel[j] = crand() * velscale;
1535  p->accel[j] = 0;
1536  }
1537  p->vel[2] -= PARTICLE_GRAVITY;
1538  } else if (flags & EF_GREENGIB) {
1539  p->alpha = 1.0;
1540  p->alphavel = -1.0 / (1 + frand() * 0.4);
1541 
1542  p->color = 0xdb + (rand() & 7);
1543  p->brightness = 1.0f;
1544 
1545  for (j = 0; j < 3; j++) {
1546  p->org[j] = move[j] + crand() * orgscale;
1547  p->vel[j] = crand() * velscale;
1548  p->accel[j] = 0;
1549  }
1550  p->vel[2] -= PARTICLE_GRAVITY;
1551  } else {
1552  p->alpha = 1.0;
1553  p->alphavel = -1.0 / (1 + frand() * 0.2);
1554 
1555  p->color = 4 + (rand() & 7);
1556  p->brightness = 1.0f;
1557 
1558  for (j = 0; j < 3; j++) {
1559  p->org[j] = move[j] + crand() * orgscale;
1560  p->vel[j] = crand() * velscale;
1561  }
1562  p->accel[2] = 20;
1563  }
1564  }
1565 
1566  old->trailcount -= 5;
1567  if (old->trailcount < 100)
1568  old->trailcount = 100;
1569  VectorAdd(move, vec, move);
1570  }
1571 }

Referenced by CL_AddPacketEntities(), and CL_RocketTrail().

◆ CL_ExplosionParticles()

void CL_ExplosionParticles ( vec3_t  org)

Definition at line 1221 of file effects.c.

1222 {
1223  int i, j;
1224  cparticle_t *p;
1225 
1226  const int count = 256 * cl_particle_num_factor->value;
1227 
1228  for (i = 0; i < count; i++) {
1229  p = CL_AllocParticle();
1230  if (!p)
1231  return;
1232 
1233  p->time = cl.time;
1234 
1235  p->color = 0xe0 + (rand() & 7);
1237 
1238  for (j = 0; j < 3; j++) {
1239  p->org[j] = org[j] + ((rand() % 32) - 16);
1240  p->vel[j] = (rand() % 384) - 192;
1241  }
1242 
1243  p->accel[0] = p->accel[1] = 0;
1244  p->accel[2] = -PARTICLE_GRAVITY;
1245  p->alpha = 1.0;
1246 
1247  p->alphavel = -0.8 / (0.5 + frand() * 0.3);
1248  }
1249 }

Referenced by CL_ParseTEnt().

◆ CL_FlagTrail()

void CL_FlagTrail ( vec3_t  start,
vec3_t  end,
int  color 
)

Definition at line 1436 of file effects.c.

1437 {
1438  vec3_t move;
1439  vec3_t vec;
1440  float len;
1441  int j;
1442  cparticle_t *p;
1443  int dec;
1444 
1445  VectorCopy(start, move);
1446  VectorSubtract(end, start, vec);
1447  len = VectorNormalize(vec);
1448 
1449  dec = 5;
1450  VectorScale(vec, 5, vec);
1451 
1452  while (len > 0) {
1453  len -= dec;
1454 
1455  p = CL_AllocParticle();
1456  if (!p)
1457  return;
1458  VectorClear(p->accel);
1459 
1460  p->time = cl.time;
1461 
1462  p->alpha = 1.0;
1463  p->alphavel = -1.0 / (0.8 + frand() * 0.2);
1464 
1465  p->color = color;
1466  p->brightness = 1.0f;
1467 
1468  for (j = 0; j < 3; j++) {
1469  p->org[j] = move[j] + crand() * 16;
1470  p->vel[j] = crand() * 5;
1471  p->accel[j] = 0;
1472  }
1473 
1474  VectorAdd(move, vec, move);
1475  }
1476 }

Referenced by CL_AddPacketEntities().

◆ CL_FlyEffect()

void CL_FlyEffect ( centity_t ent,
vec3_t  origin 
)

Definition at line 1815 of file effects.c.

1816 {
1817  int n;
1818  int count;
1819  int starttime;
1820 
1821  if (ent->fly_stoptime < cl.time) {
1822  starttime = cl.time;
1823  ent->fly_stoptime = cl.time + 60000;
1824  } else {
1825  starttime = ent->fly_stoptime - 60000;
1826  }
1827 
1828  n = cl.time - starttime;
1829  if (n < 20000)
1830  count = n * 162 / 20000.0;
1831  else {
1832  n = ent->fly_stoptime - cl.time;
1833  if (n < 20000)
1834  count = n * 162 / 20000.0;
1835  else
1836  count = 162;
1837  }
1838 
1839  CL_FlyParticles(origin, count);
1840 }

Referenced by CL_AddPacketEntities().

◆ CL_FlyParticles()

static void CL_FlyParticles ( vec3_t  origin,
int  count 
)
static

Definition at line 1767 of file effects.c.

1768 {
1769  int i;
1770  cparticle_t *p;
1771  float angle;
1772  float sp, sy, cp, cy;
1773  vec3_t forward;
1774  float dist = 64;
1775  float ltime;
1776 
1777  if (count > NUMVERTEXNORMALS)
1778  count = NUMVERTEXNORMALS;
1779 
1780  ltime = (float)cl.time / 1000.0;
1781  for (i = 0; i < count; i += 2) {
1782  angle = ltime * avelocities[i][0];
1783  sy = sin(angle);
1784  cy = cos(angle);
1785  angle = ltime * avelocities[i][1];
1786  sp = sin(angle);
1787  cp = cos(angle);
1788 
1789  forward[0] = cp * cy;
1790  forward[1] = cp * sy;
1791  forward[2] = -sp;
1792 
1793  p = CL_AllocParticle();
1794  if (!p)
1795  return;
1796 
1797  p->time = cl.time;
1798 
1799  dist = sin(ltime + i) * 64;
1800  p->org[0] = origin[0] + bytedirs[i][0] * dist + forward[0] * BEAMLENGTH;
1801  p->org[1] = origin[1] + bytedirs[i][1] * dist + forward[1] * BEAMLENGTH;
1802  p->org[2] = origin[2] + bytedirs[i][2] * dist + forward[2] * BEAMLENGTH;
1803 
1804  VectorClear(p->vel);
1805  VectorClear(p->accel);
1806 
1807  p->color = 0;
1808  p->brightness = 1.0f;
1809 
1810  p->alpha = 1;
1812  }
1813 }

Referenced by CL_FlyEffect().

◆ CL_InitEffects()

void CL_InitEffects ( void  )

Definition at line 2075 of file effects.c.

2076 {
2077  int i, j;
2078 
2079  for (i = 0; i < NUMVERTEXNORMALS; i++)
2080  for (j = 0; j < 3; j++)
2081  avelocities[i][j] = (rand() & 255) * 0.01f;
2082 
2083 }

Referenced by CL_InitLocal().

◆ CL_ItemRespawnParticles()

void CL_ItemRespawnParticles ( vec3_t  org)

Definition at line 1183 of file effects.c.

1184 {
1185  int i, j;
1186  cparticle_t *p;
1187 
1188  const int count = 64 * cl_particle_num_factor->value;
1189 
1190  for (i = 0; i < count; i++) {
1191  p = CL_AllocParticle();
1192  if (!p)
1193  return;
1194 
1195  p->time = cl.time;
1196 
1197  p->color = 0xd4 + (rand() & 3); // green
1198  p->brightness = 1.0f;
1199 
1200  p->org[0] = org[0] + crand() * 8;
1201  p->org[1] = org[1] + crand() * 8;
1202  p->org[2] = org[2] + crand() * 8;
1203 
1204  for (j = 0; j < 3; j++)
1205  p->vel[j] = crand() * 8;
1206 
1207  p->accel[0] = p->accel[1] = 0;
1208  p->accel[2] = -PARTICLE_GRAVITY * 0.2;
1209  p->alpha = 1.0;
1210 
1211  p->alphavel = -1.0 / (1.0 + frand() * 0.3);
1212  }
1213 }

Referenced by entity_event().

◆ CL_LogoutEffect()

static void CL_LogoutEffect ( vec3_t  org,
int  type 
)
static

Definition at line 1138 of file effects.c.

1139 {
1140  int i, j;
1141  cparticle_t *p;
1142 
1143  for (i = 0; i < 500; i++) {
1144  p = CL_AllocParticle();
1145  if (!p)
1146  return;
1147 
1148  p->time = cl.time;
1149 
1150  int color;
1151  if (type == MZ_LOGIN)
1152  color = 0xd0 + (rand() & 7); // green
1153  else if (type == MZ_LOGOUT)
1154  color = 0x40 + (rand() & 7); // red
1155  else
1156  color = 0xe0 + (rand() & 7); // yellow
1157 
1158  p->color = color;
1159  p->brightness = 1.0f;
1160 
1161  p->org[0] = org[0] - 16 + frand() * 32;
1162  p->org[1] = org[1] - 16 + frand() * 32;
1163  p->org[2] = org[2] - 24 + frand() * 56;
1164 
1165  for (j = 0; j < 3; j++)
1166  p->vel[j] = crand() * 20;
1167 
1168  p->accel[0] = p->accel[1] = 0;
1169  p->accel[2] = -PARTICLE_GRAVITY;
1170  p->alpha = 1.0;
1171 
1172  p->alphavel = -1.0 / (1.0 + frand() * 0.3);
1173  }
1174 }

Referenced by CL_MuzzleFlash().

◆ CL_MuzzleFlash()

void CL_MuzzleFlash ( void  )

Definition at line 257 of file effects.c.

258 {
259 #if USE_DLIGHTS
260  vec3_t fv, rv;
261  cdlight_t *dl;
262 #endif
263  centity_t *pl;
264  float volume;
265  char soundname[MAX_QPATH];
266 
267 #ifdef _DEBUG
268  if (developer->integer)
269  CL_CheckEntityPresent(mz.entity, "muzzleflash");
270 #endif
271 
272  pl = &cl_entities[mz.entity];
273 
274 #if USE_DLIGHTS
275  dl = CL_AllocDlight(mz.entity);
276  VectorCopy(pl->current.origin, dl->origin);
277  AngleVectors(pl->current.angles, fv, rv, NULL);
278  VectorMA(dl->origin, 18, fv, dl->origin);
279  VectorMA(dl->origin, 16, rv, dl->origin);
280  if (mz.silenced)
281  dl->radius = 100 + (rand() & 31);
282  else
283  dl->radius = 200 + (rand() & 31);
284  //dl->minlight = 32;
285  dl->die = cl.time; // + 0.1;
286 #define DL_COLOR(r, g, b) VectorSet(dl->color, r, g, b)
287 #define DL_RADIUS(r) (dl->radius = r)
288 #define DL_DIE(t) (dl->die = cl.time + t)
289 #else
290 #define DL_COLOR(r, g, b)
291 #define DL_RADIUS(r)
292 #define DL_DIE(t)
293 #endif
294 
295  if (mz.silenced)
296  volume = 0.2;
297  else
298  volume = 1;
299 
300  switch (mz.weapon) {
301  case MZ_BLASTER:
302  DL_COLOR(1, 1, 0);
303  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/blastf1a.wav"), volume, ATTN_NORM, 0);
304  break;
305  case MZ_BLUEHYPERBLASTER:
306  DL_COLOR(0, 0, 1);
307  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/hyprbf1a.wav"), volume, ATTN_NORM, 0);
308  break;
309  case MZ_HYPERBLASTER:
310  DL_COLOR(1, 1, 0);
311  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/hyprbf1a.wav"), volume, ATTN_NORM, 0);
312  break;
313  case MZ_MACHINEGUN:
314  DL_COLOR(1, 1, 0);
315  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
316  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
317  break;
318  case MZ_SHOTGUN:
319  DL_COLOR(1, 1, 0);
320  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/shotgf1b.wav"), volume, ATTN_NORM, 0);
321  S_StartSound(NULL, mz.entity, CHAN_AUTO, S_RegisterSound("weapons/shotgr1b.wav"), volume, ATTN_NORM, 0.1);
322  break;
323  case MZ_SSHOTGUN:
324  DL_COLOR(1, 1, 0);
325  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/sshotf1b.wav"), volume, ATTN_NORM, 0);
326  break;
327  case MZ_CHAINGUN1:
328  DL_RADIUS(200 + (rand() & 31));
329  DL_COLOR(1, 0.25, 0);
330  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
331  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
332  break;
333  case MZ_CHAINGUN2:
334  DL_RADIUS(225 + (rand() & 31));
335  DL_COLOR(1, 0.5, 0);
336  DL_DIE(0.1); // long delay
337  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
338  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
339  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
340  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0.05);
341  break;
342  case MZ_CHAINGUN3:
343  DL_RADIUS(250 + (rand() & 31));
344  DL_COLOR(1, 1, 0);
345  DL_DIE(0.1); // long delay
346  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
347  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
348  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
349  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0.033);
350  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
351  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0.066);
352  break;
353  case MZ_RAILGUN:
354  DL_COLOR(0.5, 0.5, 1.0);
355  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/railgf1a.wav"), volume, ATTN_NORM, 0);
356  break;
357  case MZ_ROCKET:
358  DL_COLOR(1, 0.5, 0.2);
359  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/rocklf1a.wav"), volume, ATTN_NORM, 0);
360  S_StartSound(NULL, mz.entity, CHAN_AUTO, S_RegisterSound("weapons/rocklr1b.wav"), volume, ATTN_NORM, 0.1);
361  break;
362  case MZ_GRENADE:
363  DL_COLOR(1, 0.5, 0);
364  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), volume, ATTN_NORM, 0);
365  S_StartSound(NULL, mz.entity, CHAN_AUTO, S_RegisterSound("weapons/grenlr1b.wav"), volume, ATTN_NORM, 0.1);
366  break;
367  case MZ_BFG:
368  DL_COLOR(0, 1, 0);
369  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/bfg__f1y.wav"), volume, ATTN_NORM, 0);
370  break;
371  case MZ_LOGIN:
372  DL_COLOR(0, 1, 0);
373  DL_DIE(1.0);
374  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), 1, ATTN_NORM, 0);
375  CL_LogoutEffect(pl->current.origin, mz.weapon);
376  break;
377  case MZ_LOGOUT:
378  DL_COLOR(1, 0, 0);
379  DL_DIE(1.0);
380  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), 1, ATTN_NORM, 0);
381  CL_LogoutEffect(pl->current.origin, mz.weapon);
382  break;
383  case MZ_RESPAWN:
384  DL_COLOR(1, 1, 0);
385  DL_DIE(1.0);
386  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), 1, ATTN_NORM, 0);
387  CL_LogoutEffect(pl->current.origin, mz.weapon);
388  break;
389  case MZ_PHALANX:
390  DL_COLOR(1, 0.5, 0.5);
391  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/plasshot.wav"), volume, ATTN_NORM, 0);
392  break;
393  case MZ_IONRIPPER:
394  DL_COLOR(1, 0.5, 0.5);
395  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/rippfiref.wav"), volume, ATTN_NORM, 0);
396  break;
397 
398  case MZ_ETF_RIFLE:
399  DL_COLOR(0.9, 0.7, 0);
400  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/nail1.wav"), volume, ATTN_NORM, 0);
401  break;
402  case MZ_SHOTGUN2:
403  DL_COLOR(1, 1, 0);
404  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/shotg2.wav"), volume, ATTN_NORM, 0);
405  break;
406  case MZ_HEATBEAM:
407  DL_COLOR(1, 1, 0);
408  DL_DIE(100);
409 // S_StartSound (NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/bfg__l1a.wav"), volume, ATTN_NORM, 0);
410  break;
411  case MZ_BLASTER2:
412  DL_COLOR(0, 1, 0);
413  // FIXME - different sound for blaster2 ??
414  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/blastf1a.wav"), volume, ATTN_NORM, 0);
415  break;
416  case MZ_TRACKER:
417  // negative flashes handled the same in gl/soft until CL_AddDLights
418  DL_COLOR(-1, -1, -1);
419  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/disint2.wav"), volume, ATTN_NORM, 0);
420  break;
421  case MZ_NUKE1:
422  DL_COLOR(1, 0, 0);
423  DL_DIE(100);
424  break;
425  case MZ_NUKE2:
426  DL_COLOR(1, 1, 0);
427  DL_DIE(100);
428  break;
429  case MZ_NUKE4:
430  DL_COLOR(0, 0, 1);
431  DL_DIE(100);
432  break;
433  case MZ_NUKE8:
434  DL_COLOR(0, 1, 1);
435  DL_DIE(100);
436  break;
437 
438  // Q2RTX
439  case MZ_FLARE:
440  DL_RADIUS(0);
441  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/flaregun.wav"), volume, ATTN_NORM, 0);
442  break;
443  // Q2RTX
444  }
445 
446  if (vid_rtx->integer)
447  {
448  // don't add muzzle flashes in RTX mode
449  DL_RADIUS(0.f);
450  }
451 }

Referenced by CL_ParseServerMessage().

◆ CL_MuzzleFlash2()

void CL_MuzzleFlash2 ( void  )

Definition at line 459 of file effects.c.

460 {
461  centity_t *ent;
462  vec3_t origin;
463  const vec_t *ofs;
464 #if USE_DLIGHTS
465  cdlight_t *dl;
466 #endif
467  vec3_t forward, right;
468  char soundname[MAX_QPATH];
469 
470  // locate the origin
471  ent = &cl_entities[mz.entity];
472  AngleVectors(ent->current.angles, forward, right, NULL);
474  origin[0] = ent->current.origin[0] + forward[0] * ofs[0] + right[0] * ofs[1];
475  origin[1] = ent->current.origin[1] + forward[1] * ofs[0] + right[1] * ofs[1];
476  origin[2] = ent->current.origin[2] + forward[2] * ofs[0] + right[2] * ofs[1] + ofs[2];
477 
478 #if USE_DLIGHTS
479  dl = CL_AllocDlight(mz.entity);
480  VectorCopy(origin, dl->origin);
481  dl->radius = 200 + (rand() & 31);
482  //dl->minlight = 32;
483  dl->die = cl.time; // + 0.1;
484 #endif
485 
486  switch (mz.weapon) {
487  case MZ2_INFANTRY_MACHINEGUN_1:
488  case MZ2_INFANTRY_MACHINEGUN_2:
489  case MZ2_INFANTRY_MACHINEGUN_3:
490  case MZ2_INFANTRY_MACHINEGUN_4:
491  case MZ2_INFANTRY_MACHINEGUN_5:
492  case MZ2_INFANTRY_MACHINEGUN_6:
493  case MZ2_INFANTRY_MACHINEGUN_7:
494  case MZ2_INFANTRY_MACHINEGUN_8:
495  case MZ2_INFANTRY_MACHINEGUN_9:
496  case MZ2_INFANTRY_MACHINEGUN_10:
497  case MZ2_INFANTRY_MACHINEGUN_11:
498  case MZ2_INFANTRY_MACHINEGUN_12:
499  case MZ2_INFANTRY_MACHINEGUN_13:
500  DL_COLOR(1, 1, 0);
503  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("infantry/infatck1.wav"), 1, ATTN_NORM, 0);
504  break;
505 
506  case MZ2_SOLDIER_MACHINEGUN_1:
507  case MZ2_SOLDIER_MACHINEGUN_2:
508  case MZ2_SOLDIER_MACHINEGUN_3:
509  case MZ2_SOLDIER_MACHINEGUN_4:
510  case MZ2_SOLDIER_MACHINEGUN_5:
511  case MZ2_SOLDIER_MACHINEGUN_6:
512  case MZ2_SOLDIER_MACHINEGUN_7:
513  case MZ2_SOLDIER_MACHINEGUN_8:
514  DL_COLOR(1, 1, 0);
517  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("soldier/solatck3.wav"), 1, ATTN_NORM, 0);
518  break;
519 
520  case MZ2_GUNNER_MACHINEGUN_1:
521  case MZ2_GUNNER_MACHINEGUN_2:
522  case MZ2_GUNNER_MACHINEGUN_3:
523  case MZ2_GUNNER_MACHINEGUN_4:
524  case MZ2_GUNNER_MACHINEGUN_5:
525  case MZ2_GUNNER_MACHINEGUN_6:
526  case MZ2_GUNNER_MACHINEGUN_7:
527  case MZ2_GUNNER_MACHINEGUN_8:
528  DL_COLOR(1, 1, 0);
531  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("gunner/gunatck2.wav"), 1, ATTN_NORM, 0);
532  break;
533 
534  case MZ2_ACTOR_MACHINEGUN_1:
535  case MZ2_SUPERTANK_MACHINEGUN_1:
536  case MZ2_SUPERTANK_MACHINEGUN_2:
537  case MZ2_SUPERTANK_MACHINEGUN_3:
538  case MZ2_SUPERTANK_MACHINEGUN_4:
539  case MZ2_SUPERTANK_MACHINEGUN_5:
540  case MZ2_SUPERTANK_MACHINEGUN_6:
541  case MZ2_TURRET_MACHINEGUN:
542  DL_COLOR(1, 1, 0);
545  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("infantry/infatck1.wav"), 1, ATTN_NORM, 0);
546  break;
547 
548  case MZ2_BOSS2_MACHINEGUN_L1:
549  case MZ2_BOSS2_MACHINEGUN_L2:
550  case MZ2_BOSS2_MACHINEGUN_L3:
551  case MZ2_BOSS2_MACHINEGUN_L4:
552  case MZ2_BOSS2_MACHINEGUN_L5:
553  case MZ2_CARRIER_MACHINEGUN_L1:
554  case MZ2_CARRIER_MACHINEGUN_L2:
555  DL_COLOR(1, 1, 0);
558  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("infantry/infatck1.wav"), 1, ATTN_NONE, 0);
559  break;
560 
561  case MZ2_SOLDIER_BLASTER_1:
562  case MZ2_SOLDIER_BLASTER_2:
563  case MZ2_SOLDIER_BLASTER_3:
564  case MZ2_SOLDIER_BLASTER_4:
565  case MZ2_SOLDIER_BLASTER_5:
566  case MZ2_SOLDIER_BLASTER_6:
567  case MZ2_SOLDIER_BLASTER_7:
568  case MZ2_SOLDIER_BLASTER_8:
569  case MZ2_TURRET_BLASTER:
570  DL_COLOR(1, 1, 0);
571  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("soldier/solatck2.wav"), 1, ATTN_NORM, 0);
572  break;
573 
574  case MZ2_FLYER_BLASTER_1:
575  case MZ2_FLYER_BLASTER_2:
576  DL_COLOR(1, 1, 0);
577  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("flyer/flyatck3.wav"), 1, ATTN_NORM, 0);
578  break;
579 
580  case MZ2_MEDIC_BLASTER_1:
581  DL_COLOR(1, 1, 0);
582  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("medic/medatck1.wav"), 1, ATTN_NORM, 0);
583  break;
584 
585  case MZ2_HOVER_BLASTER_1:
586  DL_COLOR(1, 1, 0);
587  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("hover/hovatck1.wav"), 1, ATTN_NORM, 0);
588  break;
589 
590  case MZ2_FLOAT_BLASTER_1:
591  DL_COLOR(1, 1, 0);
592  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("floater/fltatck1.wav"), 1, ATTN_NORM, 0);
593  break;
594 
595  case MZ2_SOLDIER_SHOTGUN_1:
596  case MZ2_SOLDIER_SHOTGUN_2:
597  case MZ2_SOLDIER_SHOTGUN_3:
598  case MZ2_SOLDIER_SHOTGUN_4:
599  case MZ2_SOLDIER_SHOTGUN_5:
600  case MZ2_SOLDIER_SHOTGUN_6:
601  case MZ2_SOLDIER_SHOTGUN_7:
602  case MZ2_SOLDIER_SHOTGUN_8:
603  DL_COLOR(1, 1, 0);
605  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("soldier/solatck1.wav"), 1, ATTN_NORM, 0);
606  break;
607 
608  case MZ2_TANK_BLASTER_1:
609  case MZ2_TANK_BLASTER_2:
610  case MZ2_TANK_BLASTER_3:
611  DL_COLOR(1, 1, 0);
612  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/tnkatck3.wav"), 1, ATTN_NORM, 0);
613  break;
614 
615  case MZ2_TANK_MACHINEGUN_1:
616  case MZ2_TANK_MACHINEGUN_2:
617  case MZ2_TANK_MACHINEGUN_3:
618  case MZ2_TANK_MACHINEGUN_4:
619  case MZ2_TANK_MACHINEGUN_5:
620  case MZ2_TANK_MACHINEGUN_6:
621  case MZ2_TANK_MACHINEGUN_7:
622  case MZ2_TANK_MACHINEGUN_8:
623  case MZ2_TANK_MACHINEGUN_9:
624  case MZ2_TANK_MACHINEGUN_10:
625  case MZ2_TANK_MACHINEGUN_11:
626  case MZ2_TANK_MACHINEGUN_12:
627  case MZ2_TANK_MACHINEGUN_13:
628  case MZ2_TANK_MACHINEGUN_14:
629  case MZ2_TANK_MACHINEGUN_15:
630  case MZ2_TANK_MACHINEGUN_16:
631  case MZ2_TANK_MACHINEGUN_17:
632  case MZ2_TANK_MACHINEGUN_18:
633  case MZ2_TANK_MACHINEGUN_19:
634  DL_COLOR(1, 1, 0);
637  Q_snprintf(soundname, sizeof(soundname), "tank/tnkatk2%c.wav", 'a' + rand() % 5);
638  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), 1, ATTN_NORM, 0);
639  break;
640 
641  case MZ2_CHICK_ROCKET_1:
642  case MZ2_TURRET_ROCKET:
643  DL_COLOR(1, 0.5, 0.2);
644  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("chick/chkatck2.wav"), 1, ATTN_NORM, 0);
645  break;
646 
647  case MZ2_TANK_ROCKET_1:
648  case MZ2_TANK_ROCKET_2:
649  case MZ2_TANK_ROCKET_3:
650  DL_COLOR(1, 0.5, 0.2);
651  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/tnkatck1.wav"), 1, ATTN_NORM, 0);
652  break;
653 
654  case MZ2_SUPERTANK_ROCKET_1:
655  case MZ2_SUPERTANK_ROCKET_2:
656  case MZ2_SUPERTANK_ROCKET_3:
657  case MZ2_BOSS2_ROCKET_1:
658  case MZ2_BOSS2_ROCKET_2:
659  case MZ2_BOSS2_ROCKET_3:
660  case MZ2_BOSS2_ROCKET_4:
661  case MZ2_CARRIER_ROCKET_1:
662 // case MZ2_CARRIER_ROCKET_2:
663 // case MZ2_CARRIER_ROCKET_3:
664 // case MZ2_CARRIER_ROCKET_4:
665  DL_COLOR(1, 0.5, 0.2);
666  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/rocket.wav"), 1, ATTN_NORM, 0);
667  break;
668 
669  case MZ2_GUNNER_GRENADE_1:
670  case MZ2_GUNNER_GRENADE_2:
671  case MZ2_GUNNER_GRENADE_3:
672  case MZ2_GUNNER_GRENADE_4:
673  DL_COLOR(1, 0.5, 0);
674  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("gunner/gunatck3.wav"), 1, ATTN_NORM, 0);
675  break;
676 
677  case MZ2_GLADIATOR_RAILGUN_1:
678  case MZ2_CARRIER_RAILGUN:
679  case MZ2_WIDOW_RAIL:
680  DL_COLOR(0.5, 0.5, 1.0);
681  break;
682 
683  case MZ2_MAKRON_BFG:
684  DL_COLOR(0.5, 1, 0.5);
685  //S_StartSound (NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("makron/bfg_firef.wav"), 1, ATTN_NORM, 0);
686  break;
687 
688  case MZ2_MAKRON_BLASTER_1:
689  case MZ2_MAKRON_BLASTER_2:
690  case MZ2_MAKRON_BLASTER_3:
691  case MZ2_MAKRON_BLASTER_4:
692  case MZ2_MAKRON_BLASTER_5:
693  case MZ2_MAKRON_BLASTER_6:
694  case MZ2_MAKRON_BLASTER_7:
695  case MZ2_MAKRON_BLASTER_8:
696  case MZ2_MAKRON_BLASTER_9:
697  case MZ2_MAKRON_BLASTER_10:
698  case MZ2_MAKRON_BLASTER_11:
699  case MZ2_MAKRON_BLASTER_12:
700  case MZ2_MAKRON_BLASTER_13:
701  case MZ2_MAKRON_BLASTER_14:
702  case MZ2_MAKRON_BLASTER_15:
703  case MZ2_MAKRON_BLASTER_16:
704  case MZ2_MAKRON_BLASTER_17:
705  DL_COLOR(1, 1, 0);
706  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("makron/blaster.wav"), 1, ATTN_NORM, 0);
707  break;
708 
709  case MZ2_JORG_MACHINEGUN_L1:
710  case MZ2_JORG_MACHINEGUN_L2:
711  case MZ2_JORG_MACHINEGUN_L3:
712  case MZ2_JORG_MACHINEGUN_L4:
713  case MZ2_JORG_MACHINEGUN_L5:
714  case MZ2_JORG_MACHINEGUN_L6:
715  DL_COLOR(1, 1, 0);
718  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("boss3/xfiref.wav"), 1, ATTN_NORM, 0);
719  break;
720 
721  case MZ2_JORG_MACHINEGUN_R1:
722  case MZ2_JORG_MACHINEGUN_R2:
723  case MZ2_JORG_MACHINEGUN_R3:
724  case MZ2_JORG_MACHINEGUN_R4:
725  case MZ2_JORG_MACHINEGUN_R5:
726  case MZ2_JORG_MACHINEGUN_R6:
727  DL_COLOR(1, 1, 0);
730  break;
731 
732  case MZ2_JORG_BFG_1:
733  DL_COLOR(0.5, 1, 0.5);
734  break;
735 
736  case MZ2_BOSS2_MACHINEGUN_R1:
737  case MZ2_BOSS2_MACHINEGUN_R2:
738  case MZ2_BOSS2_MACHINEGUN_R3:
739  case MZ2_BOSS2_MACHINEGUN_R4:
740  case MZ2_BOSS2_MACHINEGUN_R5:
741  case MZ2_CARRIER_MACHINEGUN_R1:
742  case MZ2_CARRIER_MACHINEGUN_R2:
743  DL_COLOR(1, 1, 0);
746  break;
747 
748  case MZ2_STALKER_BLASTER:
749  case MZ2_DAEDALUS_BLASTER:
750  case MZ2_MEDIC_BLASTER_2:
751  case MZ2_WIDOW_BLASTER:
752  case MZ2_WIDOW_BLASTER_SWEEP1:
753  case MZ2_WIDOW_BLASTER_SWEEP2:
754  case MZ2_WIDOW_BLASTER_SWEEP3:
755  case MZ2_WIDOW_BLASTER_SWEEP4:
756  case MZ2_WIDOW_BLASTER_SWEEP5:
757  case MZ2_WIDOW_BLASTER_SWEEP6:
758  case MZ2_WIDOW_BLASTER_SWEEP7:
759  case MZ2_WIDOW_BLASTER_SWEEP8:
760  case MZ2_WIDOW_BLASTER_SWEEP9:
761  case MZ2_WIDOW_BLASTER_100:
762  case MZ2_WIDOW_BLASTER_90:
763  case MZ2_WIDOW_BLASTER_80:
764  case MZ2_WIDOW_BLASTER_70:
765  case MZ2_WIDOW_BLASTER_60:
766  case MZ2_WIDOW_BLASTER_50:
767  case MZ2_WIDOW_BLASTER_40:
768  case MZ2_WIDOW_BLASTER_30:
769  case MZ2_WIDOW_BLASTER_20:
770  case MZ2_WIDOW_BLASTER_10:
771  case MZ2_WIDOW_BLASTER_0:
772  case MZ2_WIDOW_BLASTER_10L:
773  case MZ2_WIDOW_BLASTER_20L:
774  case MZ2_WIDOW_BLASTER_30L:
775  case MZ2_WIDOW_BLASTER_40L:
776  case MZ2_WIDOW_BLASTER_50L:
777  case MZ2_WIDOW_BLASTER_60L:
778  case MZ2_WIDOW_BLASTER_70L:
779  case MZ2_WIDOW_RUN_1:
780  case MZ2_WIDOW_RUN_2:
781  case MZ2_WIDOW_RUN_3:
782  case MZ2_WIDOW_RUN_4:
783  case MZ2_WIDOW_RUN_5:
784  case MZ2_WIDOW_RUN_6:
785  case MZ2_WIDOW_RUN_7:
786  case MZ2_WIDOW_RUN_8:
787  DL_COLOR(0, 1, 0);
788  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/tnkatck3.wav"), 1, ATTN_NORM, 0);
789  break;
790 
791  case MZ2_WIDOW_DISRUPTOR:
792  DL_COLOR(-1, -1, -1);
793  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/disint2.wav"), 1, ATTN_NORM, 0);
794  break;
795 
796  case MZ2_WIDOW_PLASMABEAM:
797  case MZ2_WIDOW2_BEAMER_1:
798  case MZ2_WIDOW2_BEAMER_2:
799  case MZ2_WIDOW2_BEAMER_3:
800  case MZ2_WIDOW2_BEAMER_4:
801  case MZ2_WIDOW2_BEAMER_5:
802  case MZ2_WIDOW2_BEAM_SWEEP_1:
803  case MZ2_WIDOW2_BEAM_SWEEP_2:
804  case MZ2_WIDOW2_BEAM_SWEEP_3:
805  case MZ2_WIDOW2_BEAM_SWEEP_4:
806  case MZ2_WIDOW2_BEAM_SWEEP_5:
807  case MZ2_WIDOW2_BEAM_SWEEP_6:
808  case MZ2_WIDOW2_BEAM_SWEEP_7:
809  case MZ2_WIDOW2_BEAM_SWEEP_8:
810  case MZ2_WIDOW2_BEAM_SWEEP_9:
811  case MZ2_WIDOW2_BEAM_SWEEP_10:
812  case MZ2_WIDOW2_BEAM_SWEEP_11:
813  DL_RADIUS(300 + (rand() & 100));
814  DL_COLOR(1, 1, 0);
815  DL_DIE(200);
816  break;
817  }
818 }

Referenced by CL_ParseServerMessage().

◆ CL_OldRailTrail()

void CL_OldRailTrail ( void  )

Definition at line 1632 of file effects.c.

1633 {
1634  vec3_t move;
1635  vec3_t vec;
1636  float len;
1637  int j;
1638  cparticle_t *p;
1639  float dec;
1640  vec3_t right, up;
1641  int i;
1642  float d, c, s;
1643  vec3_t dir;
1644  byte clr = 0x74;
1645 
1646  VectorCopy(te.pos1, move);
1647  VectorSubtract(te.pos2, te.pos1, vec);
1648  len = VectorNormalize(vec);
1649 
1650  MakeNormalVectors(vec, right, up);
1651 
1652  for (i = 0; i < len; i++) {
1653  p = CL_AllocParticle();
1654  if (!p)
1655  return;
1656 
1657  p->time = cl.time;
1658  VectorClear(p->accel);
1659 
1660  d = i * 0.1;
1661  c = cos(d);
1662  s = sin(d);
1663 
1664  VectorScale(right, c, dir);
1665  VectorMA(dir, s, up, dir);
1666 
1667  p->alpha = 1.0;
1668  p->alphavel = -1.0 / (1 + frand() * 0.2);
1669 
1670  p->color = clr + (rand() & 7);
1672 
1673  for (j = 0; j < 3; j++) {
1674  p->org[j] = move[j] + dir[j] * 3;
1675  p->vel[j] = dir[j] * 6;
1676  }
1677 
1678  VectorAdd(move, vec, move);
1679  }
1680 
1681  dec = 0.75;
1682  VectorScale(vec, dec, vec);
1683  VectorCopy(te.pos1, move);
1684 
1685  while (len > 0) {
1686  len -= dec;
1687 
1688  p = CL_AllocParticle();
1689  if (!p)
1690  return;
1691 
1692  p->time = cl.time;
1693  VectorClear(p->accel);
1694 
1695  p->alpha = 1.0;
1696  p->alphavel = -1.0 / (0.6 + frand() * 0.2);
1697 
1698  p->color = rand() & 15;
1699  p->brightness = 1.0f;
1700 
1701  for (j = 0; j < 3; j++) {
1702  p->org[j] = move[j] + crand() * 3;
1703  p->vel[j] = crand() * 3;
1704  p->accel[j] = 0;
1705  }
1706 
1707  VectorAdd(move, vec, move);
1708  }
1709 }

Referenced by CL_RailTrail().

◆ CL_ParticleEffect()

void CL_ParticleEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 877 of file effects.c.

878 {
879  vec3_t oy;
880  VectorSet(oy, 0.0f, 1.0f, 0.0f);
881  if (fabs(DotProduct(oy, dir)) > 0.95f)
882  VectorSet(oy, 1.0f, 0.0f, 0.0f);
883 
884  vec3_t ox;
885  CrossProduct(oy, dir, ox);
886 
887  count *= cl_particle_num_factor->value;
888  const int spark_count = count / 10;
889 
890  const float dirt_horizontal_spread = 2.0f;
891  const float dirt_vertical_spread = 1.0f;
892  const float dirt_base_velocity = 40.0f;
893  const float dirt_rand_velocity = 70.0f;
894 
895  const float spark_horizontal_spread = 1.0f;
896  const float spark_vertical_spread = 1.0f;
897  const float spark_base_velocity = 50.0f;
898  const float spark_rand_velocity = 130.0f;
899 
900  for (int i = 0; i < count; i++) {
902  if (!p)
903  return;
904 
905  p->time = cl.time;
906 
907  p->color = color + (rand() & 7);
908  p->brightness = 0.5f;
909 
910  vec3_t origin;
911  VectorCopy(org, origin);
912  VectorMA(origin, dirt_horizontal_spread * crand(), ox, origin);
913  VectorMA(origin, dirt_horizontal_spread * crand(), oy, origin);
914  VectorMA(origin, dirt_vertical_spread * frand() + 1.0f, dir, origin);
915  VectorCopy(origin, p->org);
916 
917  vec3_t velocity;
918  VectorSubtract(origin, org, velocity);
919  VectorNormalize(velocity);
920  VectorScale(velocity, dirt_base_velocity + frand() * dirt_rand_velocity, p->vel);
921 
922  p->accel[0] = p->accel[1] = 0;
923  p->accel[2] = -PARTICLE_GRAVITY;
924  p->alpha = 1.0;
925 
926  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
927  }
928 
929  for (int i = 0; i < spark_count; i++) {
931  if (!p)
932  return;
933 
934  p->time = cl.time;
935 
936  p->color = 0xe0 + (rand() & 7);
938 
939  vec3_t origin;
940  VectorCopy(org, origin);
941  VectorMA(origin, spark_horizontal_spread * crand(), ox, origin);
942  VectorMA(origin, spark_horizontal_spread * crand(), oy, origin);
943  VectorMA(origin, spark_vertical_spread * frand() + 1.0f, dir, origin);
944  VectorCopy(origin, p->org);
945 
946  vec3_t velocity;
947  VectorSubtract(origin, org, velocity);
948  VectorNormalize(velocity);
949  VectorScale(velocity, spark_base_velocity + powf(frand(), 2.0f) * spark_rand_velocity, p->vel);
950 
951  p->accel[0] = p->accel[1] = 0;
952  p->accel[2] = -PARTICLE_GRAVITY;
953  p->alpha = 1.0;
954 
955  p->alphavel = -2.0 / (0.5 + frand() * 0.3);
956  }
957 }

Referenced by CL_MuzzleFlash2(), and CL_ParseTEnt().

◆ CL_ParticleEffect2()

void CL_ParticleEffect2 ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 1060 of file effects.c.

1061 {
1062  int i, j;
1063  cparticle_t *p;
1064  float d;
1065 
1066  count *= cl_particle_num_factor->value;
1067 
1068  for (i = 0; i < count; i++) {
1069  p = CL_AllocParticle();
1070  if (!p)
1071  return;
1072 
1073  p->time = cl.time;
1074 
1075  p->color = color;
1076  p->brightness = 1.0f;
1077 
1078  d = rand() & 7;
1079  for (j = 0; j < 3; j++) {
1080  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
1081  p->vel[j] = crand() * 20;
1082  }
1083 
1084  p->accel[0] = p->accel[1] = 0;
1085  p->accel[2] = -PARTICLE_GRAVITY;
1086  p->alpha = 1.0;
1087 
1088  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1089  }
1090 }

Referenced by CL_ParseTEnt().

◆ CL_ParticleEffectWaterSplash()

void CL_ParticleEffectWaterSplash ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 959 of file effects.c.

960 {
961  vec3_t oy;
962  VectorSet(oy, 0.0f, 1.0f, 0.0f);
963  if (fabs(DotProduct(oy, dir)) > 0.95f)
964  VectorSet(oy, 1.0f, 0.0f, 0.0f);
965 
966  vec3_t ox;
967  CrossProduct(oy, dir, ox);
968 
969  count *= cl_particle_num_factor->value;
970 
971  const float water_horizontal_spread = 0.25f;
972  const float water_vertical_spread = 1.0f;
973  const float water_base_velocity = 80.0f;
974  const float water_rand_velocity = 150.0f;
975 
976  for (int i = 0; i < count; i++) {
978  if (!p)
979  return;
980 
981  p->time = cl.time;
982 
983  p->color = color + (rand() & 7);
984  p->brightness = 1.0f;
985 
986  vec3_t origin;
987  VectorCopy(org, origin);
988  VectorMA(origin, water_horizontal_spread * crand(), ox, origin);
989  VectorMA(origin, water_horizontal_spread * crand(), oy, origin);
990  VectorMA(origin, water_vertical_spread * frand() + 1.0f, dir, origin);
991  VectorCopy(origin, p->org);
992 
993  vec3_t velocity;
994  VectorSubtract(origin, org, velocity);
995  VectorNormalize(velocity);
996  VectorScale(velocity, water_base_velocity + frand() * water_rand_velocity, p->vel);
997 
998  p->accel[0] = p->accel[1] = 0;
999  p->accel[2] = -PARTICLE_GRAVITY;
1000  p->alpha = 1.0;
1001 
1002  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1003  }
1004 }

Referenced by CL_ParseTEnt().

◆ CL_QuadTrail()

void CL_QuadTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 1388 of file effects.c.

1389 {
1390  vec3_t move;
1391  vec3_t vec;
1392  float len;
1393  int j;
1394  cparticle_t *p;
1395  int dec;
1396 
1397  VectorCopy(start, move);
1398  VectorSubtract(end, start, vec);
1399  len = VectorNormalize(vec);
1400 
1401  dec = 5;
1402  VectorScale(vec, 5, vec);
1403 
1404  while (len > 0) {
1405  len -= dec;
1406 
1407  p = CL_AllocParticle();
1408  if (!p)
1409  return;
1410  VectorClear(p->accel);
1411 
1412  p->time = cl.time;
1413 
1414  p->alpha = 1.0;
1415  p->alphavel = -1.0 / (0.8 + frand() * 0.2);
1416 
1417  p->color = 115;
1419 
1420  for (j = 0; j < 3; j++) {
1421  p->org[j] = move[j] + crand() * 16;
1422  p->vel[j] = crand() * 5;
1423  p->accel[j] = 0;
1424  }
1425 
1426  VectorAdd(move, vec, move);
1427  }
1428 }

◆ CL_RocketTrail()

void CL_RocketTrail ( vec3_t  start,
vec3_t  end,
centity_t old 
)

Definition at line 1579 of file effects.c.

1580 {
1581  vec3_t move;
1582  vec3_t vec;
1583  float len;
1584  int j;
1585  cparticle_t *p;
1586  float dec;
1587 
1588  // smoke
1589  CL_DiminishingTrail(start, end, old, EF_ROCKET);
1590 
1591  // fire
1592  VectorCopy(start, move);
1593  VectorSubtract(end, start, vec);
1594  len = VectorNormalize(vec);
1595 
1596  dec = 1;
1597  VectorScale(vec, dec, vec);
1598 
1599  while (len > 0) {
1600  len -= dec;
1601 
1602  if ((rand() & 7) == 0) {
1603  p = CL_AllocParticle();
1604  if (!p)
1605  return;
1606 
1607  VectorClear(p->accel);
1608  p->time = cl.time;
1609 
1610  p->alpha = 1.0;
1611  p->alphavel = -1.0 / (1 + frand() * 0.2);
1612 
1613  p->color = 0xdc + (rand() & 3);
1615 
1616  for (j = 0; j < 3; j++) {
1617  p->org[j] = move[j] + crand() * 5;
1618  p->vel[j] = crand() * 20;
1619  }
1620  p->accel[2] = -PARTICLE_GRAVITY;
1621  }
1622  VectorAdd(move, vec, move);
1623  }
1624 }

Referenced by CL_AddPacketEntities().

◆ CL_TeleporterParticles()

void CL_TeleporterParticles ( vec3_t  org)

Definition at line 1098 of file effects.c.

1099 {
1100  int i, j;
1101  cparticle_t *p;
1102 
1103  const int count = 8 * cl_particle_num_factor->value;
1104 
1105  for (i = 0; i < count; i++) {
1106  p = CL_AllocParticle();
1107  if (!p)
1108  return;
1109 
1110  p->time = cl.time;
1111 
1112  p->color = 0xdb;
1113  p->brightness = 1.0f;
1114 
1115  for (j = 0; j < 2; j++) {
1116  p->org[j] = org[j] - 16 + (rand() & 31);
1117  p->vel[j] = crand() * 14;
1118  }
1119 
1120  p->org[2] = org[2] - 8 + (rand() & 7);
1121  p->vel[2] = 80 + (rand() & 7);
1122 
1123  p->accel[0] = p->accel[1] = 0;
1124  p->accel[2] = -PARTICLE_GRAVITY;
1125  p->alpha = 1.0;
1126 
1127  p->alphavel = -0.5;
1128  }
1129 }

Referenced by entity_event().

◆ CL_TeleportParticles()

void CL_TeleportParticles ( vec3_t  org)

Definition at line 1942 of file effects.c.

1943 {
1944  int i, j, k;
1945  cparticle_t *p;
1946  float vel;
1947  vec3_t dir;
1948 
1949  for (i = -16; i <= 16; i += 4)
1950  for (j = -16; j <= 16; j += 4)
1951  for (k = -16; k <= 32; k += 4) {
1952  p = CL_AllocParticle();
1953  if (!p)
1954  return;
1955 
1956  p->time = cl.time;
1957 
1958  p->color = 7 + (rand() & 7);
1959  p->brightness = 1.0f;
1960 
1961  p->alpha = 1.0;
1962  p->alphavel = -1.0 / (0.3 + (rand() & 7) * 0.02);
1963 
1964  p->org[0] = org[0] + i + (rand() & 3);
1965  p->org[1] = org[1] + j + (rand() & 3);
1966  p->org[2] = org[2] + k + (rand() & 3);
1967 
1968  dir[0] = j * 8;
1969  dir[1] = i * 8;
1970  dir[2] = k * 8;
1971 
1972  VectorNormalize(dir);
1973  vel = 50 + (rand() & 63);
1974  VectorScale(dir, vel, p->vel);
1975 
1976  p->accel[0] = p->accel[1] = 0;
1977  p->accel[2] = -PARTICLE_GRAVITY;
1978  }
1979 }

Referenced by CL_ParseTEnt(), and entity_event().

◆ FX_Init()

void FX_Init ( void  )

Definition at line 838 of file effects.c.

839 {
840  cvar_pt_particle_emissive = Cvar_Get("pt_particle_emissive", "10.0", 0);
841  cl_particle_num_factor = Cvar_Get("cl_particle_num_factor", "1", 0);
842 }

Referenced by CL_InitRefresh().

Variable Documentation

◆ active_particles

cparticle_t* active_particles
static

Definition at line 828 of file effects.c.

Referenced by CL_AddParticles(), CL_AllocParticle(), and CL_ClearParticles().

◆ avelocities

vec3_t avelocities[NUMVERTEXNORMALS]
static

Definition at line 25 of file effects.c.

Referenced by CL_BfgParticles(), CL_FlyParticles(), and CL_InitEffects().

◆ cl_numparticles

const int cl_numparticles = MAX_PARTICLES
static

Definition at line 831 of file effects.c.

Referenced by CL_ClearParticles().

◆ cl_particle_num_factor

◆ cvar_pt_particle_emissive

◆ d_8to24table

uint32_t d_8to24table[256]

Definition at line 654 of file images.c.

◆ free_particles

cparticle_t * free_particles
static

Definition at line 828 of file effects.c.

Referenced by CL_AddParticles(), CL_AllocParticle(), and CL_ClearParticles().

◆ particles

cparticle_t particles[MAX_PARTICLES]
static

Definition at line 830 of file effects.c.

Referenced by CL_ClearParticles(), update_transparency(), and write_particle_geometry().

◆ r_numparticles

int r_numparticles

Definition at line 61 of file view.c.

Referenced by CL_AddParticles(), V_AddParticle(), V_ClearScene(), and V_RenderView().

◆ r_particles

particle_t r_particles[MAX_PARTICLES]

Definition at line 62 of file view.c.

Referenced by CL_AddParticles(), V_AddParticle(), and V_RenderView().

tent_params_t::pos1
vec3_t pos1
Definition: client.h:661
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
S_RegisterSound
qhandle_t S_RegisterSound(const char *name)
Definition: main.c:391
cparticle_s
Definition: client.h:780
active_particles
static cparticle_t * active_particles
Definition: effects.c:828
fv
static float fv
Definition: edge.c:59
cparticle_s::brightness
float brightness
Definition: client.h:792
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
particles
static cparticle_t particles[MAX_PARTICLES]
Definition: effects.c:830
cl_numparticles
static const int cl_numparticles
Definition: effects.c:831
cparticle_s::vel
vec3_t vel
Definition: client.h:786
cparticle_s::accel
vec3_t accel
Definition: client.h:787
CL_DiminishingTrail
void CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
Definition: effects.c:1484
CL_SmokeAndFlash
void CL_SmokeAndFlash(vec3_t origin)
Definition: tent.c:207
CL_LogoutEffect
static void CL_LogoutEffect(vec3_t org, int type)
Definition: effects.c:1138
R_AddDecal
void(* R_AddDecal)(decal_t *d)
Definition: refresh.c:427
cparticle_s::next
struct cparticle_s * next
Definition: client.h:781
cparticle_s::alphavel
float alphavel
Definition: client.h:790
DL_COLOR
#define DL_COLOR(r, g, b)
cparticle_s::rgba
color_t rgba
Definition: client.h:791
centity_s::current
entity_state_t current
Definition: client.h:86
r_numparticles
int r_numparticles
Definition: view.c:61
forward
static vec3_t forward
Definition: p_view.c:27
CL_FlyParticles
static void CL_FlyParticles(vec3_t origin, int count)
Definition: effects.c:1767
cparticle_s::org
vec3_t org
Definition: client.h:785
origin
static vec3_t origin
Definition: mesh.c:27
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: shared.c:23
client_state_s::time
int time
Definition: client.h:244
CL_ClearParticles
static void CL_ClearParticles(void)
Definition: effects.c:844
centity_s
Definition: client.h:85
cl
client_state_t cl
Definition: main.c:99
c
statCounters_t c
Definition: main.c:30
cparticle_s::color
int color
Definition: client.h:788
r_particles
particle_t r_particles[MAX_PARTICLES]
Definition: view.c:62
mz
mz_params_t mz
Definition: parse.c:656
up
static vec3_t up
Definition: p_view.c:27
PARTICLE_GRAVITY
#define PARTICLE_GRAVITY
Definition: client.h:776
mz_params_t::silenced
int silenced
Definition: client.h:675
right
static vec3_t right
Definition: p_view.c:27
centity_s::trailcount
int trailcount
Definition: client.h:93
te
tent_params_t te
Definition: parse.c:655
centity_s::fly_stoptime
int fly_stoptime
Definition: client.h:103
mz_params_t::weapon
int weapon
Definition: client.h:674
monster_flash_offset
const vec3_t monster_flash_offset[256]
Definition: m_flash.c:25
CL_AllocParticle
cparticle_t * CL_AllocParticle(void)
Definition: effects.c:856
CL_ParticleEffect
void CL_ParticleEffect(vec3_t org, vec3_t dir, int color, int count)
Definition: effects.c:877
color
static vec4_t color
Definition: mesh.c:33
cparticle_s::time
float time
Definition: client.h:783
vid_rtx
cvar_t * vid_rtx
Definition: refresh.c:30
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: main.c:101
avelocities
static vec3_t avelocities[NUMVERTEXNORMALS]
Definition: effects.c:25
INSTANT_PARTICLE
#define INSTANT_PARTICLE
Definition: client.h:778
bytedirs
const vec3_t bytedirs[NUMVERTEXNORMALS]
Definition: math.c:80
S_StartSound
void S_StartSound(const vec3_t origin, int entnum, int entchannel, qhandle_t hSfx, float vol, float attenuation, float timeofs)
Definition: main.c:824
mz_params_t::entity
int entity
Definition: client.h:673
cparticle_s::alpha
float alpha
Definition: client.h:789
DL_RADIUS
#define DL_RADIUS(r)
BEAMLENGTH
#define BEAMLENGTH
Definition: effects.c:1765
cl_particle_num_factor
static cvar_t * cl_particle_num_factor
Definition: effects.c:836
DL_DIE
#define DL_DIE(t)
tent_params_t::pos2
vec3_t pos2
Definition: client.h:662
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: shared.c:55
free_particles
static cparticle_t * free_particles
Definition: effects.c:828
cvar_pt_particle_emissive
cvar_t * cvar_pt_particle_emissive
Definition: effects.c:835