2001-05-09 05:41:34 +00:00
|
|
|
/*
|
|
|
|
gl_dyn_part.c
|
|
|
|
|
|
|
|
OpenGL particle system.
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
2003-01-15 15:31:36 +00:00
|
|
|
|
2012-02-22 07:32:34 +00:00
|
|
|
#define NH_DEFINE
|
|
|
|
#include "namehack.h"
|
2003-01-15 15:31:36 +00:00
|
|
|
|
2001-05-09 05:41:34 +00:00
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
# include <string.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STRINGS_H
|
|
|
|
# include <strings.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "QF/cmd.h"
|
2001-05-31 03:41:35 +00:00
|
|
|
#include "QF/cvar.h"
|
2001-05-09 05:41:34 +00:00
|
|
|
#include "QF/qargs.h"
|
2002-08-27 07:16:28 +00:00
|
|
|
#include "QF/quakefs.h"
|
2001-05-29 19:43:15 +00:00
|
|
|
#include "QF/render.h"
|
2001-05-09 05:41:34 +00:00
|
|
|
#include "QF/sys.h"
|
2010-08-24 07:20:07 +00:00
|
|
|
#include "QF/va.h"
|
2001-06-24 09:25:55 +00:00
|
|
|
#include "QF/GL/defines.h"
|
|
|
|
#include "QF/GL/funcs.h"
|
2001-10-09 20:35:17 +00:00
|
|
|
#include "QF/GL/qf_explosions.h"
|
2001-10-28 04:23:37 +00:00
|
|
|
#include "QF/GL/qf_textures.h"
|
2003-02-06 21:47:33 +00:00
|
|
|
#include "QF/GL/qf_vid.h"
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-06-29 02:43:04 +00:00
|
|
|
#include "compat.h"
|
2012-02-14 08:28:09 +00:00
|
|
|
#include "r_internal.h"
|
2001-06-29 02:43:04 +00:00
|
|
|
#include "varrays.h"
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2012-02-17 09:33:07 +00:00
|
|
|
static int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
|
|
|
|
//static int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
|
|
|
|
static int ramp3[8] = { 0x6d, 0x6b, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 };
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2012-02-17 09:33:07 +00:00
|
|
|
static int partUseVA;
|
|
|
|
static int pVAsize;
|
|
|
|
static int *pVAindices;
|
|
|
|
static varray_t2f_c4ub_v3f_t *particleVertexArray;
|
2001-12-19 04:03:57 +00:00
|
|
|
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-11-06 21:02:18 +00:00
|
|
|
inline static void
|
2002-01-03 05:29:38 +00:00
|
|
|
particle_new (ptype_t type, int texnum, const vec3_t org, float scale,
|
2002-01-04 03:32:59 +00:00
|
|
|
const vec3_t vel, float die, int color, float alpha, float ramp)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
|
|
|
particle_t *part;
|
|
|
|
|
2001-09-18 23:22:57 +00:00
|
|
|
/*
|
2002-09-13 01:08:21 +00:00
|
|
|
// Uncomment this for particle debugging!
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles >= r_maxparticles) {
|
2002-05-14 06:12:29 +00:00
|
|
|
Sys_Error ("FAILED PARTICLE ALLOC!");
|
2001-05-09 05:41:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2001-09-18 23:22:57 +00:00
|
|
|
*/
|
2001-05-09 05:41:34 +00:00
|
|
|
|
|
|
|
part = &particles[numparticles++];
|
|
|
|
|
|
|
|
VectorCopy (org, part->org);
|
|
|
|
part->color = color;
|
|
|
|
part->tex = texnum;
|
|
|
|
part->scale = scale;
|
2002-01-04 03:32:59 +00:00
|
|
|
part->alpha = alpha;
|
|
|
|
VectorCopy (vel, part->vel);
|
|
|
|
part->type = type;
|
|
|
|
part->die = die;
|
|
|
|
part->ramp = ramp;
|
2012-01-15 11:14:36 +00:00
|
|
|
part->phys = R_ParticlePhysics (type);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2003-08-09 04:38:11 +00:00
|
|
|
/*
|
|
|
|
particle_new_random
|
2003-08-15 20:26:09 +00:00
|
|
|
|
2003-08-09 04:38:11 +00:00
|
|
|
note that org_fuzz & vel_fuzz should be ints greater than 0 if you are
|
|
|
|
going to bother using this function.
|
|
|
|
*/
|
2001-11-06 21:02:18 +00:00
|
|
|
inline static void
|
2002-01-03 05:29:38 +00:00
|
|
|
particle_new_random (ptype_t type, int texnum, const vec3_t org, int org_fuzz,
|
2002-01-04 03:32:59 +00:00
|
|
|
float scale, int vel_fuzz, float die, int color,
|
|
|
|
float alpha, float ramp)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2003-08-15 20:26:09 +00:00
|
|
|
float o_fuzz = org_fuzz, v_fuzz = vel_fuzz;
|
|
|
|
int rnd;
|
2001-09-01 08:57:04 +00:00
|
|
|
vec3_t porg, pvel;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2003-08-15 20:26:09 +00:00
|
|
|
rnd = rand ();
|
|
|
|
porg[0] = o_fuzz * ((rnd & 63) - 31.5) / 63.0 + org[0];
|
|
|
|
porg[1] = o_fuzz * (((rnd >> 5) & 63) - 31.5) / 63.0 + org[1];
|
|
|
|
porg[2] = o_fuzz * (((rnd >> 10) & 63) - 31.5) / 63.0 + org[2];
|
|
|
|
rnd = rand ();
|
|
|
|
pvel[0] = v_fuzz * ((rnd & 63) - 31.5) / 63.0;
|
|
|
|
pvel[1] = v_fuzz * (((rnd >> 5) & 63) - 31.5) / 63.0;
|
|
|
|
pvel[2] = v_fuzz * (((rnd >> 10) & 63) - 31.5) / 63.0;
|
|
|
|
|
|
|
|
particle_new (type, texnum, porg, scale, pvel, die, color, alpha, ramp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
inline static void
|
|
|
|
particle_new_veryrandom (ptype_t type, int texnum, const vec3_t org,
|
|
|
|
int org_fuzz, float scale, int vel_fuzz, float die,
|
|
|
|
int color, float alpha, float ramp)
|
|
|
|
{
|
|
|
|
vec3_t porg, pvel;
|
|
|
|
|
|
|
|
porg[0] = qfrandom (org_fuzz * 2) - org_fuzz + org[0];
|
|
|
|
porg[1] = qfrandom (org_fuzz * 2) - org_fuzz + org[1];
|
|
|
|
porg[2] = qfrandom (org_fuzz * 2) - org_fuzz + org[2];
|
|
|
|
pvel[0] = qfrandom (vel_fuzz * 2) - vel_fuzz;
|
|
|
|
pvel[1] = qfrandom (vel_fuzz * 2) - vel_fuzz;
|
|
|
|
pvel[2] = qfrandom (vel_fuzz * 2) - vel_fuzz;
|
2002-01-04 03:32:59 +00:00
|
|
|
particle_new (type, texnum, porg, scale, pvel, die, color, alpha, ramp);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2003-08-15 20:26:09 +00:00
|
|
|
*/
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2012-02-18 13:28:42 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_ClearParticles (void)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
|
|
|
numparticles = 0;
|
|
|
|
}
|
|
|
|
|
2001-12-19 04:03:57 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_InitParticles (void)
|
2001-12-19 04:03:57 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (r_maxparticles && r_init) {
|
2011-12-16 11:09:05 +00:00
|
|
|
if (vaelements) {
|
|
|
|
partUseVA = 0;
|
2001-12-19 04:03:57 +00:00
|
|
|
pVAsize = r_maxparticles * 4;
|
2011-12-16 11:09:05 +00:00
|
|
|
Sys_MaskPrintf (SYS_DEV,
|
|
|
|
"Particles: Vertex Array use disabled.\n");
|
|
|
|
} else {
|
|
|
|
if (vaelements > 3)
|
|
|
|
pVAsize = min ((unsigned int) (vaelements - (vaelements % 4)),
|
|
|
|
r_maxparticles * 4);
|
|
|
|
else if (vaelements >= 0)
|
|
|
|
pVAsize = r_maxparticles * 4;
|
2010-11-23 05:09:30 +00:00
|
|
|
Sys_MaskPrintf (SYS_DEV,
|
|
|
|
"Particles: %i maximum vertex elements.\n",
|
|
|
|
pVAsize);
|
2011-12-16 11:09:05 +00:00
|
|
|
}
|
|
|
|
if (particleVertexArray)
|
|
|
|
free (particleVertexArray);
|
|
|
|
particleVertexArray = (varray_t2f_c4ub_v3f_t *)
|
|
|
|
calloc (pVAsize, sizeof (varray_t2f_c4ub_v3f_t));
|
2003-02-13 21:48:28 +00:00
|
|
|
|
2011-12-16 11:09:05 +00:00
|
|
|
if (partUseVA)
|
2003-02-13 21:48:28 +00:00
|
|
|
qfglInterleavedArrays (GL_T2F_C4UB_V3F, 0, particleVertexArray);
|
|
|
|
|
2011-12-16 11:09:05 +00:00
|
|
|
if (pVAindices)
|
|
|
|
free (pVAindices);
|
|
|
|
pVAindices = (int *) calloc (pVAsize, sizeof (int));
|
|
|
|
for (i = 0; i < pVAsize; i++)
|
|
|
|
pVAindices[i] = i;
|
2001-12-19 04:03:57 +00:00
|
|
|
} else {
|
|
|
|
if (particleVertexArray) {
|
|
|
|
free (particleVertexArray);
|
|
|
|
particleVertexArray = 0;
|
|
|
|
}
|
|
|
|
if (pVAindices) {
|
|
|
|
free (pVAindices);
|
|
|
|
pVAindices = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-09 05:41:34 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_ReadPointFile_f (void)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2010-08-24 07:20:07 +00:00
|
|
|
const char *name;
|
|
|
|
char *mapname;
|
2001-09-01 08:57:04 +00:00
|
|
|
int c, r;
|
|
|
|
vec3_t org;
|
2002-08-27 07:16:28 +00:00
|
|
|
QFile *f;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-05-20 03:54:55 +00:00
|
|
|
mapname = strdup (r_worldentity.model->name);
|
2001-05-09 05:41:34 +00:00
|
|
|
if (!mapname)
|
|
|
|
Sys_Error ("Can't duplicate mapname!");
|
2010-08-24 07:20:07 +00:00
|
|
|
QFS_StripExtension (mapname, mapname);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2010-08-24 07:20:07 +00:00
|
|
|
name = va ("%s.pts", mapname);
|
2001-05-09 05:41:34 +00:00
|
|
|
free (mapname);
|
|
|
|
|
2003-02-14 19:46:07 +00:00
|
|
|
QFS_FOpenFile (name, &f);
|
2001-05-09 05:41:34 +00:00
|
|
|
if (!f) {
|
2007-11-06 10:17:14 +00:00
|
|
|
Sys_Printf ("couldn't open %s\n", name);
|
2001-05-09 05:41:34 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-11-23 05:09:30 +00:00
|
|
|
Sys_MaskPrintf (SYS_DEV, "Reading %s...\n", name);
|
2001-05-09 05:41:34 +00:00
|
|
|
c = 0;
|
|
|
|
for (;;) {
|
|
|
|
char buf[64];
|
|
|
|
|
|
|
|
Qgets (f, buf, sizeof (buf));
|
|
|
|
r = sscanf (buf, "%f %f %f\n", &org[0], &org[1], &org[2]);
|
|
|
|
if (r != 3)
|
|
|
|
break;
|
|
|
|
c++;
|
|
|
|
|
2001-10-28 00:47:21 +00:00
|
|
|
if (numparticles >= r_maxparticles) {
|
2010-11-23 05:09:30 +00:00
|
|
|
Sys_MaskPrintf (SYS_DEV, "Not enough free particles\n");
|
2001-05-09 05:41:34 +00:00
|
|
|
break;
|
2001-10-28 00:47:21 +00:00
|
|
|
} else {
|
|
|
|
particle_new (pt_static, part_tex_dot, org, 1.5, vec3_origin,
|
2002-01-04 03:32:59 +00:00
|
|
|
99999, (-c) & 15, 1.0, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Qclose (f);
|
2010-11-23 05:09:30 +00:00
|
|
|
Sys_MaskPrintf (SYS_DEV, "%i points read\n", c);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_ParticleExplosion_QF (const vec3_t org)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2002-09-13 01:08:21 +00:00
|
|
|
// R_NewExplosion (org);
|
2001-12-11 22:37:30 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
2001-11-20 08:31:27 +00:00
|
|
|
particle_new_random (pt_smokecloud, part_tex_smoke, org, 4, 30, 8,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, (rand () & 7) + 8,
|
2002-01-04 03:32:59 +00:00
|
|
|
0.5 + qfrandom (0.25), 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2001-11-20 08:31:27 +00:00
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2003-10-22 06:00:36 +00:00
|
|
|
unsigned int i, j = 512;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
2001-09-19 18:07:09 +00:00
|
|
|
else if (numparticles + j >= r_maxparticles)
|
|
|
|
j = r_maxparticles - numparticles;
|
2001-09-18 23:22:57 +00:00
|
|
|
|
|
|
|
for (i = 0; i < j; i++) {
|
2012-05-21 23:23:22 +00:00
|
|
|
particle_new_random (pt_blob, part_tex_dot, org, 16, 2, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.3,
|
2006-12-01 07:03:13 +00:00
|
|
|
colorStart + (i % colorLength), 1.0, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_BlobExplosion_QF (const vec3_t org)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2002-01-04 03:32:59 +00:00
|
|
|
unsigned int i;
|
|
|
|
unsigned int j = 1024;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
2001-09-19 18:07:09 +00:00
|
|
|
else if (numparticles + j >= r_maxparticles)
|
|
|
|
j = r_maxparticles - numparticles;
|
2001-09-18 23:22:57 +00:00
|
|
|
|
2002-01-04 03:32:59 +00:00
|
|
|
for (i = 0; i < j >> 1; i++) {
|
2001-05-09 05:41:34 +00:00
|
|
|
particle_new_random (pt_blob, part_tex_dot, org, 12, 2, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 1.0 + (rand () & 7) * 0.05,
|
2003-08-09 04:38:11 +00:00
|
|
|
66 + i % 6, 1.0, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2001-09-18 23:22:57 +00:00
|
|
|
for (i = 0; i < j / 2; i++) {
|
2001-05-09 05:41:34 +00:00
|
|
|
particle_new_random (pt_blob2, part_tex_dot, org, 12, 2, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 1.0 + (rand () & 7) * 0.05,
|
2003-08-09 04:38:11 +00:00
|
|
|
150 + i % 6, 1.0, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-11 22:37:30 +00:00
|
|
|
static inline void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_RunSparkEffect_QF (const vec3_t org, int count, int ofuzz)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
2003-08-09 04:38:11 +00:00
|
|
|
particle_new (pt_smokecloud, part_tex_smoke, org, ofuzz * 0.08,
|
2012-02-14 08:28:09 +00:00
|
|
|
vec3_origin, vr_data.realtime + 9, 12 + (rand () & 3),
|
2003-08-09 04:38:11 +00:00
|
|
|
0.25 + qfrandom (0.125), 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles + count >= r_maxparticles)
|
|
|
|
count = r_maxparticles - numparticles;
|
2003-08-09 04:38:11 +00:00
|
|
|
if (count) {
|
|
|
|
int orgfuzz = ofuzz * 3 / 4;
|
|
|
|
if (orgfuzz < 1)
|
|
|
|
orgfuzz = 1;
|
|
|
|
|
|
|
|
while (count--) {
|
|
|
|
int color = rand () & 7;
|
2003-08-11 20:48:34 +00:00
|
|
|
|
|
|
|
particle_new_random (pt_fallfadespark, part_tex_dot, org, orgfuzz,
|
2012-02-14 08:28:09 +00:00
|
|
|
0.7, 96, vr_data.realtime + 5.0, ramp1[color],
|
|
|
|
1.0, color);
|
2003-08-09 04:38:11 +00:00
|
|
|
}
|
2002-09-17 02:14:58 +00:00
|
|
|
}
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2001-12-11 22:37:30 +00:00
|
|
|
static inline void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_BloodPuff_QF (const vec3_t org, int count)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
|
|
|
|
2002-01-04 03:32:59 +00:00
|
|
|
particle_new (pt_bloodcloud, part_tex_smoke, org, count / 5, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2001-05-09 06:00:19 +00:00
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_BloodPuffEffect_QF (const vec3_t org, int count)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2001-12-11 22:37:30 +00:00
|
|
|
R_BloodPuff_QF (org, count);
|
|
|
|
}
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_GunshotEffect_QF (const vec3_t org, int count)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
|
|
|
int scale = 16;
|
2001-09-17 01:48:52 +00:00
|
|
|
|
2003-08-09 04:38:11 +00:00
|
|
|
scale += count / 15;
|
2001-12-11 22:37:30 +00:00
|
|
|
R_RunSparkEffect_QF (org, count >> 1, scale);
|
|
|
|
}
|
2001-09-18 23:22:57 +00:00
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_LightningBloodEffect_QF (const vec3_t org)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
|
|
|
int count = 7;
|
|
|
|
|
|
|
|
R_BloodPuff_QF (org, 50);
|
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
2002-06-15 10:54:26 +00:00
|
|
|
particle_new (pt_smokecloud, part_tex_smoke, org, 3.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 9.0, 12 + (rand () & 3),
|
2002-01-04 03:32:59 +00:00
|
|
|
0.25 + qfrandom (0.125), 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles + count >= r_maxparticles)
|
|
|
|
count = r_maxparticles - numparticles;
|
|
|
|
while (count--)
|
2003-08-09 04:38:11 +00:00
|
|
|
particle_new_random (pt_fallfade, part_tex_spark, org, 12, 2.0, 128,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, 244 + (count % 3), 1.0,
|
|
|
|
0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
|
2002-01-03 05:29:38 +00:00
|
|
|
int count)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2003-04-17 00:01:48 +00:00
|
|
|
float scale;
|
2003-08-11 20:48:34 +00:00
|
|
|
int i;
|
2003-04-17 00:01:48 +00:00
|
|
|
vec3_t porg;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
2002-08-26 00:11:16 +00:00
|
|
|
scale = pow (count, 0.23); // calculate scale before clipping to part. max
|
2002-01-04 03:32:59 +00:00
|
|
|
|
2001-09-27 00:43:46 +00:00
|
|
|
if (numparticles + count >= r_maxparticles)
|
|
|
|
count = r_maxparticles - numparticles;
|
2001-09-18 23:22:57 +00:00
|
|
|
|
2001-05-09 05:41:34 +00:00
|
|
|
for (i = 0; i < count; i++) {
|
2003-08-11 20:48:34 +00:00
|
|
|
int rnd = rand ();
|
|
|
|
|
|
|
|
porg[0] = org[0] + scale * (((rnd >> 3) & 15) - 7.5);
|
|
|
|
porg[1] = org[1] + scale * (((rnd >> 7) & 15) - 7.5);
|
|
|
|
porg[2] = org[2] + scale * (((rnd >> 11) & 15) - 7.5);
|
2002-01-04 03:32:59 +00:00
|
|
|
// Note that ParseParticleEffect handles (dir * 15)
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 1.5, dir,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.1 * (i % 5),
|
2003-08-11 20:48:34 +00:00
|
|
|
(color & ~7) + (rnd & 7), 1.0, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_SpikeEffect_QF (const vec3_t org)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2001-12-11 22:37:30 +00:00
|
|
|
R_RunSparkEffect_QF (org, 5, 8);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_SuperSpikeEffect_QF (const vec3_t org)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
|
|
|
R_RunSparkEffect_QF (org, 10, 8);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_KnightSpikeEffect_QF (const vec3_t org)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
2002-01-04 03:32:59 +00:00
|
|
|
unsigned int count = 10;
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
2002-06-15 10:54:26 +00:00
|
|
|
particle_new (pt_smokecloud, part_tex_smoke, org, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 9.0, 234, 0.25 + qfrandom (0.125), 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles + count >= r_maxparticles)
|
|
|
|
count = r_maxparticles - numparticles;
|
|
|
|
while (count--)
|
2002-09-17 02:14:58 +00:00
|
|
|
particle_new_random (pt_fallfade, part_tex_dot, org, 6, 0.7, 96,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, 234, 1.0, 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_WizSpikeEffect_QF (const vec3_t org)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
2002-01-04 03:32:59 +00:00
|
|
|
unsigned int count = 15;
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
2002-06-15 10:54:26 +00:00
|
|
|
particle_new (pt_smokecloud, part_tex_smoke, org, 2.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 9.0, 63, 0.25 + qfrandom (0.125), 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles + count >= r_maxparticles)
|
|
|
|
count = r_maxparticles - numparticles;
|
|
|
|
while (count--)
|
2002-09-17 02:14:58 +00:00
|
|
|
particle_new_random (pt_fallfade, part_tex_dot, org, 12, 0.7, 96,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, 63, 1.0, 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_LavaSplash_QF (const vec3_t org)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
|
|
|
float vel;
|
2001-11-06 21:02:18 +00:00
|
|
|
int rnd, i, j;
|
2001-09-18 23:22:57 +00:00
|
|
|
int k = 256;
|
2001-05-09 05:41:34 +00:00
|
|
|
vec3_t dir, porg, pvel;
|
|
|
|
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles + k >= r_maxparticles) {
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
2001-09-19 18:07:09 +00:00
|
|
|
} // else if (numparticles + k >= r_maxparticles) {
|
|
|
|
// k = r_maxparticles - numparticles;
|
2001-09-18 23:22:57 +00:00
|
|
|
// }
|
|
|
|
|
2001-10-02 09:11:20 +00:00
|
|
|
dir[2] = 256;
|
2001-09-18 23:22:57 +00:00
|
|
|
for (i = -128; i < 128; i += 16) {
|
|
|
|
for (j = -128; j < 128; j += 16) {
|
2001-11-06 21:02:18 +00:00
|
|
|
rnd = rand ();
|
|
|
|
dir[0] = j + (rnd & 7);
|
|
|
|
dir[1] = i + ((rnd >> 6) & 7);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
|
|
|
porg[0] = org[0] + dir[0];
|
|
|
|
porg[1] = org[1] + dir[1];
|
2001-11-06 21:02:18 +00:00
|
|
|
porg[2] = org[2] + ((rnd >> 9) & 63);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
|
|
|
VectorNormalize (dir);
|
2001-11-06 21:02:18 +00:00
|
|
|
rnd = rand ();
|
2003-08-11 20:48:34 +00:00
|
|
|
vel = 50.0 + 0.5 * (float) (rnd & 127);
|
2001-05-09 05:41:34 +00:00
|
|
|
VectorScale (dir, vel, pvel);
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 3, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0 + ((rnd >> 7) & 31) * 0.02,
|
2002-01-04 03:32:59 +00:00
|
|
|
224 + ((rnd >> 12) & 7), 0.75, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_TeleportSplash_QF (const vec3_t org)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
|
|
|
float vel;
|
2001-11-06 21:02:18 +00:00
|
|
|
int rnd, i, j, k;
|
2001-09-18 23:22:57 +00:00
|
|
|
int l = 896;
|
2002-01-04 03:32:59 +00:00
|
|
|
vec3_t dir, pdir, porg, pvel;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-09-19 18:07:09 +00:00
|
|
|
if (numparticles + l >= r_maxparticles) {
|
2001-09-18 23:22:57 +00:00
|
|
|
return;
|
2001-09-19 18:07:09 +00:00
|
|
|
} // else if (numparticles + l >= r_maxparticles) {
|
|
|
|
// l = r_maxparticles - numparticles;
|
2001-09-18 23:22:57 +00:00
|
|
|
// }
|
|
|
|
|
2002-07-25 14:43:36 +00:00
|
|
|
for (k = -24; k < 32; k += 4) {
|
|
|
|
dir[2] = k * 8;
|
|
|
|
for (i = -16; i < 16; i += 4) {
|
|
|
|
dir[1] = i * 8;
|
|
|
|
for (j = -16; j < 16; j += 4) {
|
|
|
|
dir[0] = j * 8;
|
|
|
|
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorCopy (dir, pdir);
|
|
|
|
VectorNormalize (pdir);
|
|
|
|
|
2001-11-06 21:02:18 +00:00
|
|
|
rnd = rand ();
|
|
|
|
porg[0] = org[0] + i + (rnd & 3);
|
|
|
|
porg[1] = org[1] + j + ((rnd >> 2) & 3);
|
|
|
|
porg[2] = org[2] + k + ((rnd >> 4) & 3);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-11-06 21:02:18 +00:00
|
|
|
vel = 50 + ((rnd >> 6) & 63);
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorScale (pdir, vel, pvel);
|
2001-05-09 05:41:34 +00:00
|
|
|
particle_new (pt_grav, part_tex_spark, porg, 0.6, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
(vr_data.realtime + 0.2 + (rand () & 15) * 0.01),
|
2002-01-04 03:32:59 +00:00
|
|
|
(7 + ((rnd >> 12) & 7)), 1.0, 0.0);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2001-10-02 09:11:20 +00:00
|
|
|
}
|
|
|
|
}
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_RocketTrail_QF (const entity_t *ent)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2001-11-09 12:09:46 +00:00
|
|
|
float dist, maxlen, origlen, percent, pscale, pscalenext;
|
2001-11-24 08:21:07 +00:00
|
|
|
float len = 0.0;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, vec;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = 1.5 + qfrandom (1.5);
|
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2001-09-06 04:26:53 +00:00
|
|
|
pscalenext = 1.5 + qfrandom (1.5);
|
2001-09-09 19:37:07 +00:00
|
|
|
dist = (pscale + pscalenext) * 3.0;
|
2001-11-02 20:47:47 +00:00
|
|
|
percent = len * origlen;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
2001-11-15 01:37:57 +00:00
|
|
|
pscale + percent * 4.0, vec3_origin,
|
2012-05-21 23:23:22 +00:00
|
|
|
vr_data.realtime + 2.0 - percent * 2.0,
|
2001-11-15 23:36:14 +00:00
|
|
|
12 + (rand () & 3),
|
2002-01-04 03:32:59 +00:00
|
|
|
0.5 + qfrandom (0.125) - percent * 0.40, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorMultAdd (old_origin, len, vec, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = pscalenext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_GrenadeTrail_QF (const entity_t *ent)
|
2001-09-06 04:26:53 +00:00
|
|
|
{
|
2001-11-09 12:09:46 +00:00
|
|
|
float dist, maxlen, origlen, percent, pscale, pscalenext;
|
2001-11-24 08:21:07 +00:00
|
|
|
float len = 0.0;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, vec;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = 6.0 + qfrandom (7.0);
|
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2001-09-06 04:26:53 +00:00
|
|
|
pscalenext = 6.0 + qfrandom (7.0);
|
2001-09-07 05:37:11 +00:00
|
|
|
dist = (pscale + pscalenext) * 2.0;
|
2001-11-02 20:47:47 +00:00
|
|
|
percent = len * origlen;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
2001-11-15 01:37:57 +00:00
|
|
|
pscale + percent * 4.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0 - percent * 2.0,
|
2001-11-24 08:21:07 +00:00
|
|
|
1 + (rand () & 3),
|
2002-01-04 03:32:59 +00:00
|
|
|
0.625 + qfrandom (0.125) - percent * 0.40, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorMultAdd (old_origin, len, vec, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = pscalenext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_BloodTrail_QF (const entity_t *ent)
|
2001-09-06 04:26:53 +00:00
|
|
|
{
|
2001-11-09 12:09:46 +00:00
|
|
|
float dist, maxlen, origlen, percent, pscale, pscalenext;
|
2001-11-24 08:21:07 +00:00
|
|
|
float len = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
int j;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, porg, pvel, vec;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = 5.0 + qfrandom (10.0);
|
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2001-09-06 04:26:53 +00:00
|
|
|
pscalenext = 5.0 + qfrandom (10.0);
|
2001-09-07 05:37:11 +00:00
|
|
|
dist = (pscale + pscalenext) * 1.5;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
|
|
|
for (j = 0; j < 3; j++) {
|
2001-11-06 21:02:18 +00:00
|
|
|
pvel[j] = qfrandom (24.0) - 12.0;
|
2003-10-22 22:21:39 +00:00
|
|
|
porg[j] = old_origin[j] + qfrandom (3.0) - 1.5;
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
2001-11-02 20:47:47 +00:00
|
|
|
percent = len * origlen;
|
2002-01-04 03:32:59 +00:00
|
|
|
pvel[2] -= percent * 40.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-24 17:52:13 +00:00
|
|
|
particle_new (pt_grav, part_tex_smoke, porg, pscale, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0 - percent * 2.0,
|
|
|
|
68 + (rand () & 3), 1.0, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorMultAdd (old_origin, len, vec, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = pscalenext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_SlightBloodTrail_QF (const entity_t *ent)
|
2001-09-06 04:26:53 +00:00
|
|
|
{
|
2001-11-09 12:09:46 +00:00
|
|
|
float dist, maxlen, origlen, percent, pscale, pscalenext;
|
2002-01-04 03:32:59 +00:00
|
|
|
float len = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
int j;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, porg, pvel, vec;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = 1.5 + qfrandom (7.5);
|
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2001-09-06 04:26:53 +00:00
|
|
|
pscalenext = 1.5 + qfrandom (7.5);
|
|
|
|
dist = (pscale + pscalenext) * 1.5;
|
|
|
|
|
|
|
|
for (j = 0; j < 3; j++) {
|
2001-09-07 05:37:11 +00:00
|
|
|
pvel[j] = (qfrandom (12.0) - 6.0);
|
2003-10-22 22:21:39 +00:00
|
|
|
porg[j] = old_origin[j] + qfrandom (3.0) - 1.5;
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
2001-11-02 20:47:47 +00:00
|
|
|
percent = len * origlen;
|
|
|
|
pvel[2] -= percent * 40;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-24 17:52:13 +00:00
|
|
|
particle_new (pt_grav, part_tex_smoke, porg, pscale, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 1.5 - percent * 1.5,
|
|
|
|
68 + (rand () & 3), 0.75, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorMultAdd (old_origin, len, vec, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
pscale = pscalenext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_WizTrail_QF (const entity_t *ent)
|
2001-09-06 04:26:53 +00:00
|
|
|
{
|
2001-11-24 08:21:07 +00:00
|
|
|
float maxlen, origlen, percent;
|
|
|
|
float dist = 3.0, len = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
static int tracercount;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, pvel, subtract, vec;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2002-01-04 03:32:59 +00:00
|
|
|
percent = len * origlen;
|
|
|
|
|
2001-09-06 04:26:53 +00:00
|
|
|
tracercount++;
|
|
|
|
if (tracercount & 1) {
|
2001-11-24 08:21:07 +00:00
|
|
|
pvel[0] = 30.0 * vec[1];
|
|
|
|
pvel[1] = 30.0 * -vec[0];
|
2001-09-06 04:26:53 +00:00
|
|
|
} else {
|
2001-11-24 08:21:07 +00:00
|
|
|
pvel[0] = 30.0 * -vec[1];
|
|
|
|
pvel[1] = 30.0 * vec[0];
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
2002-01-04 03:32:59 +00:00
|
|
|
pvel[2] = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_flame, part_tex_smoke, old_origin,
|
2001-11-09 12:09:46 +00:00
|
|
|
2.0 + qfrandom (1.0) - percent * 2.0, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.5 - percent * 0.5,
|
|
|
|
52 + (rand () & 4), 1.0 - percent * 0.125, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_FlameTrail_QF (const entity_t *ent)
|
2001-09-06 04:26:53 +00:00
|
|
|
{
|
2001-11-24 08:21:07 +00:00
|
|
|
float maxlen, origlen, percent;
|
|
|
|
float dist = 3.0, len = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
static int tracercount;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, pvel, subtract, vec;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2002-01-04 03:32:59 +00:00
|
|
|
percent = len * origlen;
|
|
|
|
|
2001-09-06 04:26:53 +00:00
|
|
|
tracercount++;
|
|
|
|
if (tracercount & 1) {
|
2001-11-24 08:21:07 +00:00
|
|
|
pvel[0] = 30.0 * vec[1];
|
|
|
|
pvel[1] = 30.0 * -vec[0];
|
2001-09-06 04:26:53 +00:00
|
|
|
} else {
|
2001-11-24 08:21:07 +00:00
|
|
|
pvel[0] = 30.0 * -vec[1];
|
|
|
|
pvel[1] = 30.0 * vec[0];
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
2002-01-04 03:32:59 +00:00
|
|
|
pvel[2] = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_flame, part_tex_smoke, old_origin,
|
2001-11-09 12:09:46 +00:00
|
|
|
2.0 + qfrandom (1.0) - percent * 2.0, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.5 - percent * 0.5, 234,
|
2002-01-04 03:32:59 +00:00
|
|
|
1.0 - percent * 0.125, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_VoorTrail_QF (const entity_t *ent)
|
2001-09-06 04:26:53 +00:00
|
|
|
{
|
2001-11-24 08:21:07 +00:00
|
|
|
float maxlen, origlen, percent;
|
|
|
|
float dist = 3.0, len = 0.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
int j;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t subtract, old_origin, porg, vec;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-09-22 02:37:45 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
2001-09-07 05:37:11 +00:00
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-11-09 12:09:46 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2001-09-06 04:26:53 +00:00
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
while (len < maxlen) {
|
2002-01-04 03:32:59 +00:00
|
|
|
percent = len * origlen;
|
|
|
|
|
2001-09-06 04:26:53 +00:00
|
|
|
for (j = 0; j < 3; j++)
|
2003-10-22 22:21:39 +00:00
|
|
|
porg[j] = old_origin[j] + qfrandom (16.0) - 8.0;
|
2001-09-06 04:26:53 +00:00
|
|
|
|
|
|
|
particle_new (pt_static, part_tex_dot, porg, 1.0 + qfrandom (1.0),
|
2012-02-14 08:28:09 +00:00
|
|
|
vec3_origin, vr_data.realtime + 0.3 - percent * 0.3,
|
2002-01-04 03:32:59 +00:00
|
|
|
9 * 16 + 8 + (rand () & 3), 1.0, 0.0);
|
2001-11-09 12:09:46 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2001-09-06 04:26:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_GlowTrail_QF (const entity_t *ent, int glow_color)
|
2002-07-25 14:43:36 +00:00
|
|
|
{
|
2002-09-13 01:08:21 +00:00
|
|
|
float maxlen, origlen, percent;
|
2002-07-25 14:43:36 +00:00
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
int rnd;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, org, subtract, vec;
|
2002-07-25 14:43:36 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2002-07-25 14:43:36 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2002-07-25 14:43:36 +00:00
|
|
|
VectorScale (vec, (maxlen - dist), subtract);
|
|
|
|
|
|
|
|
while (len < maxlen) {
|
2002-09-13 01:08:21 +00:00
|
|
|
percent = len * origlen;
|
|
|
|
|
2002-07-25 14:43:36 +00:00
|
|
|
rnd = rand ();
|
2003-10-22 22:21:39 +00:00
|
|
|
org[0] = old_origin[0] + ((rnd >> 12) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
org[1] = old_origin[1] + ((rnd >> 9) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
org[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
2002-07-25 14:43:36 +00:00
|
|
|
|
2002-09-13 01:08:21 +00:00
|
|
|
particle_new (pt_smoke, part_tex_dot, org, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0 - percent * 0.2,
|
|
|
|
glow_color, 1.0, 0.0);
|
2002-07-25 14:43:36 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-07-25 14:43:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_ParticleExplosion_EE (const vec3_t org)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
R_NewExplosion (org);
|
|
|
|
*/
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
particle_new_random (pt_smokecloud, part_tex_smoke, org, 4, 30, 8,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, rand () & 255,
|
2002-01-04 03:32:59 +00:00
|
|
|
0.5 + qfrandom (0.25), 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_TeleportSplash_EE (const vec3_t org)
|
2001-12-19 04:03:57 +00:00
|
|
|
{
|
|
|
|
float vel;
|
|
|
|
int rnd, i, j, k;
|
|
|
|
int l = 896;
|
|
|
|
vec3_t dir, porg, pvel;
|
|
|
|
|
|
|
|
if (numparticles + l >= r_maxparticles) {
|
|
|
|
return;
|
|
|
|
} // else if (numparticles + l >= r_maxparticles) {
|
|
|
|
// l = r_maxparticles - numparticles;
|
|
|
|
// }
|
|
|
|
|
2002-07-25 14:43:36 +00:00
|
|
|
for (k = -24; k < 32; k += 4) {
|
|
|
|
dir[2] = k * 8;
|
|
|
|
for (i = -16; i < 16; i += 4) {
|
|
|
|
dir[1] = i * 8;
|
|
|
|
for (j = -16; j < 16; j += 4) {
|
|
|
|
dir[0] = j * 8;
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-12-19 04:03:57 +00:00
|
|
|
rnd = rand ();
|
|
|
|
porg[0] = org[0] + i + (rnd & 3);
|
|
|
|
porg[1] = org[1] + j + ((rnd >> 2) & 3);
|
|
|
|
porg[2] = org[2] + k + ((rnd >> 4) & 3);
|
|
|
|
|
|
|
|
VectorNormalize (dir);
|
|
|
|
vel = 50 + ((rnd >> 6) & 63);
|
|
|
|
VectorScale (dir, vel, pvel);
|
|
|
|
particle_new (pt_grav, part_tex_spark, porg, 0.6, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
(vr_data.realtime + 0.2 + (rand () & 15) * 0.01),
|
2002-01-04 03:32:59 +00:00
|
|
|
qfrandom (1.0), 1.0, 0.0);
|
2001-12-19 04:03:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_RocketTrail_EE (const entity_t *ent)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
|
|
|
float dist, maxlen, origlen, percent, pscale, pscalenext;
|
|
|
|
float len = 0.0;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, subtract, vec;
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2001-12-11 22:37:30 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2001-12-11 22:37:30 +00:00
|
|
|
pscale = 1.5 + qfrandom (1.5);
|
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
pscalenext = 1.5 + qfrandom (1.5);
|
|
|
|
dist = (pscale + pscalenext) * 3.0;
|
|
|
|
percent = len * origlen;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
2001-12-11 22:37:30 +00:00
|
|
|
pscale + percent * 4.0, vec3_origin,
|
2012-05-21 23:23:22 +00:00
|
|
|
vr_data.realtime + 2.0 - percent * 2.0,
|
2001-12-11 22:37:30 +00:00
|
|
|
rand () & 255,
|
2002-01-04 03:32:59 +00:00
|
|
|
0.5 + qfrandom (0.125) - percent * 0.40, 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorScale (vec, len, subtract);
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2001-12-11 22:37:30 +00:00
|
|
|
pscale = pscalenext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_GrenadeTrail_EE (const entity_t *ent)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
|
|
|
float dist, maxlen, origlen, percent, pscale, pscalenext;
|
|
|
|
float len = 0.0;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, subtract, vec;
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
2001-12-11 22:37:30 +00:00
|
|
|
VectorSubtract (ent->origin, ent->old_origin, vec);
|
|
|
|
maxlen = VectorNormalize (vec);
|
2012-02-14 08:28:09 +00:00
|
|
|
origlen = vr_data.frametime / maxlen;
|
2001-12-11 22:37:30 +00:00
|
|
|
pscale = 6.0 + qfrandom (7.0);
|
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
pscalenext = 6.0 + qfrandom (7.0);
|
|
|
|
dist = (pscale + pscalenext) * 2.0;
|
|
|
|
percent = len * origlen;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
2001-12-11 22:37:30 +00:00
|
|
|
pscale + percent * 4.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0 - percent * 2.0,
|
2001-12-11 22:37:30 +00:00
|
|
|
rand () & 255,
|
2002-01-04 03:32:59 +00:00
|
|
|
0.625 + qfrandom (0.125) - percent * 0.40, 0.0);
|
2001-12-11 22:37:30 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorScale (vec, len, subtract);
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2001-12-11 22:37:30 +00:00
|
|
|
pscale = pscalenext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-03 05:29:38 +00:00
|
|
|
R_ParticleExplosion_ID (const vec3_t org)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
2002-01-04 03:32:59 +00:00
|
|
|
unsigned int i;
|
|
|
|
unsigned int j = 1024;
|
2001-12-11 22:37:30 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
else if (numparticles + j >= r_maxparticles)
|
|
|
|
j = r_maxparticles - numparticles;
|
|
|
|
|
2003-08-11 20:48:34 +00:00
|
|
|
for (i = 0; i < j >> 1; i++) {
|
|
|
|
particle_new_random (pt_explode, part_tex_dot, org, 16, 1.0, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, ramp1[0], 1.0, i & 3);
|
2003-08-11 20:48:34 +00:00
|
|
|
}
|
|
|
|
for (i = 0; i < j / 2; i++) {
|
|
|
|
particle_new_random (pt_explode2, part_tex_dot, org, 16, 1.0, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 5.0, ramp1[0], 1.0, i & 3);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_BlobExplosion_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int j = 1024;
|
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
else if (numparticles + j >= r_maxparticles)
|
|
|
|
j = r_maxparticles - numparticles;
|
|
|
|
|
|
|
|
for (i = 0; i < j >> 1; i++) {
|
|
|
|
particle_new_random (pt_blob, part_tex_dot, org, 12, 1.0, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 1.0 + (rand () & 8) * 0.05,
|
2003-08-11 20:48:34 +00:00
|
|
|
66 + i % 6, 1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
for (i = 0; i < j / 2; i++) {
|
|
|
|
particle_new_random (pt_blob2, part_tex_dot, org, 12, 1.0, 256,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 1.0 + (rand () & 8) * 0.05,
|
2003-08-11 20:48:34 +00:00
|
|
|
150 + i % 6, 1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-08-09 04:38:11 +00:00
|
|
|
static inline void // FIXME: inline?
|
2002-01-04 03:32:59 +00:00
|
|
|
R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
|
|
|
|
int count)
|
|
|
|
{
|
|
|
|
float scale;
|
2003-08-11 05:16:04 +00:00
|
|
|
int i;
|
2002-01-04 03:32:59 +00:00
|
|
|
vec3_t porg;
|
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2002-08-26 00:11:16 +00:00
|
|
|
if (count > 130) // calculate scale before clipping to particle max
|
2002-01-04 03:32:59 +00:00
|
|
|
scale = 3.0;
|
|
|
|
else if (count > 20)
|
|
|
|
scale = 2.0;
|
|
|
|
else
|
|
|
|
scale = 1.0;
|
|
|
|
|
|
|
|
if (numparticles + count >= r_maxparticles)
|
|
|
|
count = r_maxparticles - numparticles;
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++) {
|
2003-08-09 04:38:11 +00:00
|
|
|
int rnd = rand ();
|
|
|
|
|
2003-08-11 05:16:04 +00:00
|
|
|
porg[0] = org[0] + scale * (((rnd >> 3) & 15) - 8);
|
|
|
|
porg[1] = org[1] + scale * (((rnd >> 7) & 15) - 8);
|
|
|
|
porg[2] = org[2] + scale * (((rnd >> 11) & 15) - 8);
|
2003-08-09 04:38:11 +00:00
|
|
|
|
2002-01-04 03:32:59 +00:00
|
|
|
// Note that ParseParticleEffect handles (dir * 15)
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 1.0, dir,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.1 * (i % 5),
|
2003-08-09 04:38:11 +00:00
|
|
|
(color & ~7) + (rnd & 7), 1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_BloodPuffEffect_ID (const vec3_t org, int count)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 73, count);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_GunshotEffect_ID (const vec3_t org, int count)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 0, count);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_LightningBloodEffect_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 225, 50);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_SpikeEffect_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 0, 10);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_SuperSpikeEffect_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 0, 20);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_KnightSpikeEffect_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 226, 20);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_WizSpikeEffect_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
R_RunParticleEffect_ID (org, vec3_origin, 20, 30);
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_LavaSplash_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
float vel;
|
|
|
|
int rnd, i, j;
|
|
|
|
int k = 256;
|
|
|
|
vec3_t dir, porg, pvel;
|
|
|
|
|
|
|
|
if (numparticles + k >= r_maxparticles) {
|
|
|
|
return;
|
|
|
|
} // else if (numparticles + k >= r_maxparticles) {
|
|
|
|
// k = r_maxparticles - numparticles;
|
|
|
|
// }
|
|
|
|
|
|
|
|
dir[2] = 256;
|
|
|
|
for (i = -128; i < 128; i += 16) {
|
|
|
|
for (j = -128; j < 128; j += 16) {
|
|
|
|
rnd = rand ();
|
|
|
|
dir[0] = j + (rnd & 7);
|
|
|
|
dir[1] = i + ((rnd >> 6) & 7);
|
|
|
|
|
|
|
|
porg[0] = org[0] + dir[0];
|
|
|
|
porg[1] = org[1] + dir[1];
|
|
|
|
porg[2] = org[2] + ((rnd >> 9) & 63);
|
|
|
|
|
|
|
|
VectorNormalize (dir);
|
|
|
|
rnd = rand ();
|
|
|
|
vel = 50 + (rnd & 63);
|
|
|
|
VectorScale (dir, vel, pvel);
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 1.0, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2 + ((rnd >> 7) & 31) * 0.02,
|
2002-01-04 03:32:59 +00:00
|
|
|
224 + ((rnd >> 12) & 7), 1.0, 0.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-01-04 03:32:59 +00:00
|
|
|
R_TeleportSplash_ID (const vec3_t org)
|
|
|
|
{
|
|
|
|
float vel;
|
|
|
|
int rnd, i, j, k;
|
|
|
|
int l = 896;
|
|
|
|
vec3_t dir, pdir, porg, pvel;
|
|
|
|
|
|
|
|
if (numparticles + l >= r_maxparticles) {
|
|
|
|
return;
|
|
|
|
} // else if (numparticles + l >= r_maxparticles) {
|
|
|
|
// l = r_maxparticles - numparticles;
|
|
|
|
// }
|
|
|
|
|
2002-07-25 14:43:36 +00:00
|
|
|
for (k = -24; k < 32; k += 4) {
|
|
|
|
dir[2] = k * 8;
|
|
|
|
for (i = -16; i < 16; i += 4) {
|
|
|
|
dir[1] = i * 8;
|
|
|
|
for (j = -16; j < 16; j += 4) {
|
|
|
|
dir[0] = j * 8;
|
|
|
|
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorCopy (dir, pdir);
|
|
|
|
VectorNormalize (pdir);
|
2003-02-06 21:47:33 +00:00
|
|
|
|
2002-01-04 03:32:59 +00:00
|
|
|
rnd = rand ();
|
|
|
|
porg[0] = org[0] + i + (rnd & 3);
|
|
|
|
porg[1] = org[1] + j + ((rnd >> 2) & 3);
|
|
|
|
porg[2] = org[2] + k + ((rnd >> 4) & 3);
|
|
|
|
|
|
|
|
vel = 50 + ((rnd >> 6) & 63);
|
|
|
|
VectorScale (pdir, vel, pvel);
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 1.0, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
(vr_data.realtime + 0.2 + (rand () & 7) * 0.02),
|
2002-01-04 03:32:59 +00:00
|
|
|
(7 + ((rnd >> 12) & 7)), 1.0, 0.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-22 06:00:36 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_DarkFieldParticles_ID (const entity_t *ent)
|
2003-10-22 06:00:36 +00:00
|
|
|
{
|
2003-10-22 20:20:24 +00:00
|
|
|
int i, j, k, l = 64;
|
2003-10-22 06:00:36 +00:00
|
|
|
unsigned int rnd;
|
|
|
|
float vel;
|
|
|
|
vec3_t dir, org, porg, pvel;
|
|
|
|
|
|
|
|
if (numparticles + l >= r_maxparticles) {
|
|
|
|
return;
|
|
|
|
} // else if (numparticles + l >= r_maxparticles) {
|
|
|
|
// l = r_maxparticles - numparticles;
|
|
|
|
// }
|
|
|
|
|
|
|
|
VectorCopy (ent->origin, org);
|
|
|
|
|
|
|
|
for (i = -16; i < 16; i += 8) {
|
|
|
|
dir [1] = i * 8;
|
|
|
|
for (j = -16; j < 16; j += 8) {
|
|
|
|
dir [0] = j * 8;
|
|
|
|
for (k = 0; k < 32; k += 8) {
|
|
|
|
dir [2] = k * 8;
|
|
|
|
rnd = rand ();
|
|
|
|
|
|
|
|
porg[0] = org[0] + i + ((rnd >> 3) & 3);
|
|
|
|
porg[1] = org[1] + j + ((rnd >> 5) & 3);
|
|
|
|
porg[2] = org[2] + k + ((rnd >> 7) & 3);
|
|
|
|
|
|
|
|
VectorNormalize (dir);
|
|
|
|
vel = 50 + ((rnd >> 9) & 63);
|
|
|
|
VectorScale (dir, vel, pvel);
|
|
|
|
particle_new (pt_slowgrav, part_tex_dot, porg, 1.5, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
(vr_data.realtime + 0.2 + (rnd & 7) * 0.02),
|
2003-10-22 06:00:36 +00:00
|
|
|
(150 + rand () % 6), 1.0, 0.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static vec3_t avelocities[NUMVERTEXNORMALS];
|
|
|
|
|
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_EntityParticles_ID (const entity_t *ent)
|
2003-10-22 06:00:36 +00:00
|
|
|
{
|
2003-10-22 22:21:39 +00:00
|
|
|
int i, j = NUMVERTEXNORMALS;
|
2003-10-22 06:00:36 +00:00
|
|
|
float angle, sp, sy, cp, cy; // cr, sr
|
|
|
|
float beamlength = 16.0, dist = 64.0;
|
|
|
|
vec3_t forward, porg;
|
|
|
|
|
|
|
|
if (numparticles + j >= r_maxparticles) {
|
|
|
|
return;
|
|
|
|
} else if (numparticles + j >= r_maxparticles) {
|
|
|
|
j = r_maxparticles - numparticles;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!avelocities[0][0]) {
|
|
|
|
for (i = 0; i < NUMVERTEXNORMALS * 3; i++)
|
|
|
|
avelocities[0][i] = (rand () & 255) * 0.01;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < j; i++) {
|
2012-02-14 08:28:09 +00:00
|
|
|
angle = vr_data.realtime * avelocities[i][0];
|
2003-10-22 06:00:36 +00:00
|
|
|
cy = cos (angle);
|
|
|
|
sy = sin (angle);
|
2012-02-14 08:28:09 +00:00
|
|
|
angle = vr_data.realtime * avelocities[i][1];
|
2003-10-22 06:00:36 +00:00
|
|
|
cp = cos (angle);
|
|
|
|
sp = sin (angle);
|
|
|
|
// Next 3 lines results aren't currently used, may be in future. --Despair
|
2012-02-14 08:28:09 +00:00
|
|
|
// angle = vr_data.realtime * avelocities[i][2];
|
2003-10-22 06:00:36 +00:00
|
|
|
// sr = sin (angle);
|
|
|
|
// cr = cos (angle);
|
|
|
|
|
|
|
|
forward[0] = cp * cy;
|
|
|
|
forward[1] = cp * sy;
|
|
|
|
forward[2] = -sp;
|
|
|
|
|
|
|
|
porg[0] = ent->origin[0] + r_avertexnormals[i][0] * dist +
|
|
|
|
forward[0] * beamlength;
|
|
|
|
porg[1] = ent->origin[1] + r_avertexnormals[i][1] * dist +
|
|
|
|
forward[1] * beamlength;
|
|
|
|
porg[2] = ent->origin[2] + r_avertexnormals[i][2] * dist +
|
|
|
|
forward[2] * beamlength;
|
|
|
|
particle_new (pt_explode, part_tex_dot, porg, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.01, 0x6f, 1.0, 0);
|
2003-10-22 06:00:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_RocketTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
int ramp, rnd;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, org, subtract, vec;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorSubtract (ent->origin, ent->old_origin, vec);
|
|
|
|
maxlen = VectorNormalize (vec);
|
|
|
|
VectorScale (vec, (maxlen - dist), subtract);
|
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
rnd = rand ();
|
2003-10-22 22:21:39 +00:00
|
|
|
org[0] = old_origin[0] + ((rnd >> 12) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
org[1] = old_origin[1] + ((rnd >> 9) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
org[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
ramp = rnd & 3;
|
|
|
|
|
|
|
|
particle_new (pt_fire, part_tex_dot, org, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_GrenadeTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
unsigned int ramp, rnd;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, org, subtract, vec;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
VectorSubtract (ent->origin, ent->old_origin, vec);
|
|
|
|
maxlen = VectorNormalize (vec);
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
rnd = rand ();
|
2003-10-22 22:21:39 +00:00
|
|
|
org[0] = old_origin[0] + ((rnd >> 12) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
org[1] = old_origin[1] + ((rnd >> 9) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
org[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
ramp = (rnd & 3) + 2;
|
|
|
|
|
|
|
|
particle_new (pt_fire, part_tex_dot, org, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_BloodTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
unsigned int rnd;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, subtract, vec, porg;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2002-01-04 03:32:59 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
rnd = rand ();
|
2003-10-22 22:21:39 +00:00
|
|
|
porg[0] = old_origin[0] + ((rnd >> 12) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
porg[1] = old_origin[1] + ((rnd >> 9) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
porg[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 2.0, 67 + (rnd & 3), 1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_SlightBloodTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 6.0, len = 0.0;
|
|
|
|
unsigned int rnd;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, porg, subtract, vec;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2002-01-04 03:32:59 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
rnd = rand ();
|
2003-10-22 22:21:39 +00:00
|
|
|
porg[0] = old_origin[0] + ((rnd >> 12) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
porg[1] = old_origin[1] + ((rnd >> 9) & 7) * (5.0/7.0) - 2.5;
|
|
|
|
porg[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
particle_new (pt_grav, part_tex_dot, porg, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 1.5, 67 + (rnd & 3), 1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_WizTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
static int tracercount;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, pvel, subtract, vec;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2002-01-04 03:32:59 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
tracercount++;
|
|
|
|
if (tracercount & 1) {
|
|
|
|
pvel[0] = 30.0 * vec[1];
|
|
|
|
pvel[1] = 30.0 * -vec[0];
|
|
|
|
} else {
|
|
|
|
pvel[0] = 30.0 * -vec[1];
|
|
|
|
pvel[1] = 30.0 * vec[0];
|
|
|
|
}
|
|
|
|
pvel[2] = 0.0;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_static, part_tex_dot, old_origin, 1.0, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.5, 52 + ((tracercount & 4) << 1),
|
|
|
|
1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_FlameTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
static int tracercount;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, pvel, subtract, vec;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2002-01-04 03:32:59 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
tracercount++;
|
|
|
|
if (tracercount & 1) {
|
|
|
|
pvel[0] = 30.0 * vec[1];
|
|
|
|
pvel[1] = 30.0 * -vec[0];
|
|
|
|
} else {
|
|
|
|
pvel[0] = 30.0 * -vec[1];
|
|
|
|
pvel[1] = 30.0 * vec[0];
|
|
|
|
}
|
|
|
|
pvel[2] = 0.0;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
particle_new (pt_static, part_tex_dot, old_origin, 1.0, pvel,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.5, 230 + ((tracercount & 4) << 1),
|
|
|
|
1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2003-10-22 22:21:39 +00:00
|
|
|
R_VoorTrail_ID (const entity_t *ent)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
|
|
|
float maxlen;
|
|
|
|
float dist = 3.0, len = 0.0;
|
|
|
|
unsigned int rnd;
|
2003-10-22 22:21:39 +00:00
|
|
|
vec3_t old_origin, porg, subtract, vec;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorCopy (ent->old_origin, old_origin);
|
|
|
|
VectorSubtract (ent->origin, old_origin, vec);
|
2002-01-04 03:32:59 +00:00
|
|
|
maxlen = VectorNormalize (vec);
|
2002-01-05 07:23:23 +00:00
|
|
|
VectorScale (vec, maxlen - dist, subtract);
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
while (len < maxlen) {
|
|
|
|
rnd = rand ();
|
2003-10-22 22:21:39 +00:00
|
|
|
porg[0] = old_origin[0] + ((rnd >> 3) & 15) - 7.5;
|
|
|
|
porg[1] = old_origin[1] + ((rnd >> 7) & 15) - 7.5;
|
|
|
|
porg[2] = old_origin[2] + ((rnd >> 11) & 15) - 7.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
|
|
|
|
particle_new (pt_static, part_tex_dot, porg, 1.0, vec3_origin,
|
2012-02-14 08:28:09 +00:00
|
|
|
vr_data.realtime + 0.3, 9 * 16 + 8 + (rnd & 3),
|
|
|
|
1.0, 0.0);
|
2002-01-04 03:32:59 +00:00
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
break;
|
|
|
|
len += dist;
|
2003-10-22 22:21:39 +00:00
|
|
|
VectorAdd (old_origin, subtract, old_origin);
|
2001-12-11 22:37:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-09 05:41:34 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_DrawParticles (void)
|
2001-05-09 05:41:34 +00:00
|
|
|
{
|
2001-09-14 12:11:54 +00:00
|
|
|
unsigned char *at;
|
2003-04-17 00:01:48 +00:00
|
|
|
int activeparticles, maxparticle, j, vacount;
|
|
|
|
unsigned int k;
|
2006-12-01 07:03:13 +00:00
|
|
|
float minparticledist, scale;
|
2001-09-14 12:11:54 +00:00
|
|
|
particle_t *part;
|
|
|
|
vec3_t up_scale, right_scale, up_right_scale, down_right_scale;
|
2003-08-09 04:38:11 +00:00
|
|
|
varray_t2f_c4ub_v3f_t *VA;
|
2001-09-22 02:37:45 +00:00
|
|
|
|
2001-09-05 02:04:02 +00:00
|
|
|
if (!r_particles->int_val)
|
|
|
|
return;
|
|
|
|
|
2012-02-17 09:33:07 +00:00
|
|
|
qfglBindTexture (GL_TEXTURE_2D, gl_part_tex);
|
2001-05-09 05:41:34 +00:00
|
|
|
// LordHavoc: particles should not affect zbuffer
|
2001-06-26 02:26:46 +00:00
|
|
|
qfglDepthMask (GL_FALSE);
|
2002-06-13 05:24:52 +00:00
|
|
|
qfglInterleavedArrays (GL_T2F_C4UB_V3F, 0, particleVertexArray);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2002-06-26 22:20:12 +00:00
|
|
|
minparticledist = DotProduct (r_refdef.vieworg, vpn) +
|
|
|
|
r_particles_nearclip->value;
|
2001-05-09 05:41:34 +00:00
|
|
|
|
|
|
|
activeparticles = 0;
|
2001-12-19 04:03:57 +00:00
|
|
|
vacount = 0;
|
|
|
|
VA = particleVertexArray;
|
2001-05-09 05:41:34 +00:00
|
|
|
maxparticle = -1;
|
|
|
|
j = 0;
|
|
|
|
|
|
|
|
for (k = 0, part = particles; k < numparticles; k++, part++) {
|
|
|
|
// Don't render particles too close to us.
|
|
|
|
// Note, we must still do physics and such on them.
|
2001-09-05 00:08:54 +00:00
|
|
|
if (!(DotProduct (part->org, vpn) < minparticledist)) {
|
2002-01-04 03:32:59 +00:00
|
|
|
at = (byte *) &d_8to24table[(byte) part->color];
|
2001-12-19 04:03:57 +00:00
|
|
|
VA[0].color[0] = at[0];
|
|
|
|
VA[0].color[1] = at[1];
|
|
|
|
VA[0].color[2] = at[2];
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[0].color[3] = part->alpha * 255;
|
2003-08-09 04:38:11 +00:00
|
|
|
memcpy (VA[1].color, VA[0].color, sizeof (VA[0].color));
|
|
|
|
memcpy (VA[2].color, VA[0].color, sizeof (VA[0].color));
|
|
|
|
memcpy (VA[3].color, VA[0].color, sizeof (VA[0].color));
|
2001-12-19 04:03:57 +00:00
|
|
|
|
|
|
|
switch (part->tex) {
|
2012-01-19 01:36:10 +00:00
|
|
|
case part_tex_dot:
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[0].texcoord[0] = 0.0;
|
2002-01-06 22:43:51 +00:00
|
|
|
VA[0].texcoord[1] = 0.0;
|
|
|
|
VA[1].texcoord[0] = 0.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[1].texcoord[1] = 0.0;
|
|
|
|
VA[2].texcoord[0] = 0.5;
|
2002-01-06 22:43:51 +00:00
|
|
|
VA[2].texcoord[1] = 0.5;
|
|
|
|
VA[3].texcoord[0] = 0.0;
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[3].texcoord[1] = 0.5;
|
|
|
|
break;
|
2012-01-19 01:36:10 +00:00
|
|
|
case part_tex_spark:
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[0].texcoord[0] = 0.5;
|
2002-01-06 22:43:51 +00:00
|
|
|
VA[0].texcoord[1] = 0.0;
|
|
|
|
VA[1].texcoord[0] = 1.0;
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[1].texcoord[1] = 0.0;
|
|
|
|
VA[2].texcoord[0] = 1.0;
|
2002-01-06 22:43:51 +00:00
|
|
|
VA[2].texcoord[1] = 0.5;
|
|
|
|
VA[3].texcoord[0] = 0.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[3].texcoord[1] = 0.5;
|
|
|
|
break;
|
2012-01-19 01:36:10 +00:00
|
|
|
case part_tex_smoke:
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[0].texcoord[0] = 0.0;
|
2002-01-06 22:43:51 +00:00
|
|
|
VA[0].texcoord[1] = 0.5;
|
|
|
|
VA[1].texcoord[0] = 0.5;
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[1].texcoord[1] = 0.5;
|
|
|
|
VA[2].texcoord[0] = 0.5;
|
2002-01-06 22:43:51 +00:00
|
|
|
VA[2].texcoord[1] = 1.0;
|
|
|
|
VA[3].texcoord[0] = 0.0;
|
2002-01-04 03:32:59 +00:00
|
|
|
VA[3].texcoord[1] = 1.0;
|
|
|
|
break;
|
2001-12-19 04:03:57 +00:00
|
|
|
}
|
2001-05-09 05:41:34 +00:00
|
|
|
|
|
|
|
scale = part->scale;
|
|
|
|
|
2001-12-11 22:37:30 +00:00
|
|
|
VectorScale (vup, scale, up_scale);
|
|
|
|
VectorScale (vright, scale, right_scale);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-12-11 22:37:30 +00:00
|
|
|
VectorAdd (right_scale, up_scale, up_right_scale);
|
2001-08-29 20:19:54 +00:00
|
|
|
VectorSubtract (right_scale, up_scale, down_right_scale);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2002-01-06 22:43:51 +00:00
|
|
|
VectorAdd (part->org, down_right_scale, VA[0].vertex);
|
2002-10-10 20:03:23 +00:00
|
|
|
VectorSubtract (part->org, up_right_scale, VA[1].vertex);
|
2002-01-06 22:43:51 +00:00
|
|
|
VectorSubtract (part->org, down_right_scale, VA[2].vertex);
|
2002-10-10 20:03:23 +00:00
|
|
|
VectorAdd (part->org, up_right_scale, VA[3].vertex);
|
2001-12-19 04:03:57 +00:00
|
|
|
|
|
|
|
VA += 4;
|
|
|
|
vacount += 4;
|
|
|
|
if (vacount + 4 > pVAsize) {
|
2011-12-16 11:09:05 +00:00
|
|
|
// never reached if partUseVA is false
|
2001-12-19 04:03:57 +00:00
|
|
|
qfglDrawElements (GL_QUADS, vacount, GL_UNSIGNED_INT,
|
|
|
|
pVAindices);
|
|
|
|
vacount = 0;
|
|
|
|
VA = particleVertexArray;
|
|
|
|
}
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
2012-01-15 11:14:36 +00:00
|
|
|
part->phys (part);
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-11-09 12:09:46 +00:00
|
|
|
// LordHavoc: immediate removal of unnecessary particles (must be done
|
|
|
|
// to ensure compactor below operates properly in all cases)
|
2012-02-14 08:28:09 +00:00
|
|
|
if (part->die < vr_data.realtime) {
|
2001-11-09 12:09:46 +00:00
|
|
|
freeparticles[j++] = part;
|
2006-12-01 07:03:13 +00:00
|
|
|
} else {
|
2001-11-09 12:09:46 +00:00
|
|
|
maxparticle = k;
|
|
|
|
activeparticles++;
|
|
|
|
}
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2011-12-16 11:09:05 +00:00
|
|
|
if (vacount) {
|
|
|
|
if (partUseVA) {
|
|
|
|
qfglDrawElements (GL_QUADS, vacount, GL_UNSIGNED_INT, pVAindices);
|
|
|
|
} else {
|
|
|
|
varray_t2f_c4ub_v3f_t *va = particleVertexArray;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
qfglBegin (GL_QUADS);
|
|
|
|
for (i = 0; i < vacount; i++, va++) {
|
|
|
|
qfglTexCoord2fv (va->texcoord);
|
|
|
|
qfglColor4ubv (va->color);
|
|
|
|
qfglVertex3fv (va->vertex);
|
|
|
|
}
|
|
|
|
qfglEnd ();
|
|
|
|
}
|
|
|
|
}
|
2001-12-19 04:03:57 +00:00
|
|
|
|
2001-05-09 05:41:34 +00:00
|
|
|
k = 0;
|
|
|
|
while (maxparticle >= activeparticles) {
|
|
|
|
*freeparticles[k++] = particles[maxparticle--];
|
2001-12-19 04:03:57 +00:00
|
|
|
while (maxparticle >= activeparticles &&
|
2012-02-14 08:28:09 +00:00
|
|
|
particles[maxparticle].die <= vr_data.realtime)
|
2001-05-09 05:41:34 +00:00
|
|
|
maxparticle--;
|
|
|
|
}
|
|
|
|
numparticles = activeparticles;
|
|
|
|
|
2001-08-30 18:24:19 +00:00
|
|
|
qfglColor3ubv (color_white);
|
2001-06-26 02:26:46 +00:00
|
|
|
qfglDepthMask (GL_TRUE);
|
2001-05-09 05:41:34 +00:00
|
|
|
}
|
2001-12-11 22:37:30 +00:00
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
static vid_particle_funcs_t particles_QF = {
|
|
|
|
R_RocketTrail_QF,
|
|
|
|
R_GrenadeTrail_QF,
|
|
|
|
R_BloodTrail_QF,
|
|
|
|
R_SlightBloodTrail_QF,
|
|
|
|
R_WizTrail_QF,
|
|
|
|
R_FlameTrail_QF,
|
|
|
|
R_VoorTrail_QF,
|
|
|
|
R_GlowTrail_QF,
|
|
|
|
R_RunParticleEffect_QF,
|
|
|
|
R_BloodPuffEffect_QF,
|
|
|
|
R_GunshotEffect_QF,
|
|
|
|
R_LightningBloodEffect_QF,
|
|
|
|
R_SpikeEffect_QF,
|
|
|
|
R_KnightSpikeEffect_QF,
|
|
|
|
R_SuperSpikeEffect_QF,
|
|
|
|
R_WizSpikeEffect_QF,
|
|
|
|
R_BlobExplosion_QF,
|
|
|
|
R_ParticleExplosion_QF,
|
|
|
|
R_ParticleExplosion2_QF,
|
|
|
|
R_LavaSplash_QF,
|
|
|
|
R_TeleportSplash_QF,
|
|
|
|
R_DarkFieldParticles_ID,
|
|
|
|
R_EntityParticles_ID,
|
|
|
|
};
|
|
|
|
|
|
|
|
static vid_particle_funcs_t particles_ID = {
|
|
|
|
R_RocketTrail_ID,
|
|
|
|
R_GrenadeTrail_ID,
|
|
|
|
R_BloodTrail_ID,
|
|
|
|
R_SlightBloodTrail_ID,
|
|
|
|
R_WizTrail_ID,
|
|
|
|
R_FlameTrail_ID,
|
|
|
|
R_VoorTrail_ID,
|
|
|
|
R_GlowTrail_QF,
|
|
|
|
R_RunParticleEffect_ID,
|
|
|
|
R_BloodPuffEffect_ID,
|
|
|
|
R_GunshotEffect_ID,
|
|
|
|
R_LightningBloodEffect_ID,
|
|
|
|
R_SpikeEffect_ID,
|
|
|
|
R_KnightSpikeEffect_ID,
|
|
|
|
R_SuperSpikeEffect_ID,
|
|
|
|
R_WizSpikeEffect_ID,
|
|
|
|
R_BlobExplosion_ID,
|
|
|
|
R_ParticleExplosion_ID,
|
|
|
|
R_ParticleExplosion2_QF,
|
|
|
|
R_LavaSplash_ID,
|
|
|
|
R_TeleportSplash_ID,
|
|
|
|
R_DarkFieldParticles_ID,
|
|
|
|
R_EntityParticles_ID,
|
|
|
|
};
|
|
|
|
|
|
|
|
static vid_particle_funcs_t particles_QF_egg = {
|
|
|
|
R_RocketTrail_EE,
|
|
|
|
R_GrenadeTrail_EE,
|
|
|
|
R_BloodTrail_QF,
|
|
|
|
R_SlightBloodTrail_QF,
|
|
|
|
R_WizTrail_QF,
|
|
|
|
R_FlameTrail_QF,
|
|
|
|
R_VoorTrail_QF,
|
|
|
|
R_GlowTrail_QF,
|
|
|
|
R_RunParticleEffect_QF,
|
|
|
|
R_BloodPuffEffect_QF,
|
|
|
|
R_GunshotEffect_QF,
|
|
|
|
R_LightningBloodEffect_QF,
|
|
|
|
R_SpikeEffect_QF,
|
|
|
|
R_KnightSpikeEffect_QF,
|
|
|
|
R_SuperSpikeEffect_QF,
|
|
|
|
R_WizSpikeEffect_QF,
|
|
|
|
R_BlobExplosion_QF,
|
|
|
|
R_ParticleExplosion_EE,
|
|
|
|
R_ParticleExplosion2_QF,
|
|
|
|
R_LavaSplash_QF,
|
|
|
|
R_TeleportSplash_EE,
|
|
|
|
R_DarkFieldParticles_ID,
|
|
|
|
R_EntityParticles_ID,
|
|
|
|
};
|
|
|
|
|
|
|
|
static vid_particle_funcs_t particles_ID_egg = {
|
|
|
|
R_RocketTrail_EE,
|
|
|
|
R_GrenadeTrail_EE,
|
|
|
|
R_BloodTrail_ID,
|
|
|
|
R_SlightBloodTrail_ID,
|
|
|
|
R_WizTrail_ID,
|
|
|
|
R_FlameTrail_ID,
|
|
|
|
R_VoorTrail_ID,
|
|
|
|
R_GlowTrail_QF,
|
|
|
|
R_RunParticleEffect_ID,
|
|
|
|
R_BloodPuffEffect_ID,
|
|
|
|
R_GunshotEffect_ID,
|
|
|
|
R_LightningBloodEffect_ID,
|
|
|
|
R_SpikeEffect_ID,
|
|
|
|
R_KnightSpikeEffect_ID,
|
|
|
|
R_SuperSpikeEffect_ID,
|
|
|
|
R_WizSpikeEffect_ID,
|
|
|
|
R_BlobExplosion_ID,
|
|
|
|
R_ParticleExplosion_EE,
|
|
|
|
R_ParticleExplosion2_QF,
|
|
|
|
R_LavaSplash_ID,
|
|
|
|
R_TeleportSplash_EE,
|
|
|
|
R_DarkFieldParticles_ID,
|
|
|
|
R_EntityParticles_ID,
|
|
|
|
};
|
|
|
|
|
2001-12-11 22:37:30 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_r_easter_eggs_f (cvar_t *var)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
2003-02-13 21:48:28 +00:00
|
|
|
if (easter_eggs && !gl_feature_mach64) {
|
2001-12-11 22:37:30 +00:00
|
|
|
if (easter_eggs->int_val) {
|
2012-02-14 08:28:09 +00:00
|
|
|
if (r_particles_style->int_val) {
|
2012-02-22 12:53:17 +00:00
|
|
|
gl_vid_render_funcs.particles = &particles_QF_egg;
|
2012-02-14 08:28:09 +00:00
|
|
|
} else {
|
2012-02-22 12:53:17 +00:00
|
|
|
gl_vid_render_funcs.particles = &particles_ID_egg;
|
2012-02-14 08:28:09 +00:00
|
|
|
}
|
2002-01-04 03:32:59 +00:00
|
|
|
} else if (r_particles_style) {
|
|
|
|
if (r_particles_style->int_val) {
|
2012-02-22 12:53:17 +00:00
|
|
|
gl_vid_render_funcs.particles = &particles_QF;
|
2002-01-04 03:32:59 +00:00
|
|
|
} else {
|
2012-02-22 12:53:17 +00:00
|
|
|
gl_vid_render_funcs.particles = &particles_ID;
|
2002-01-04 03:32:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_r_particles_style_f (cvar_t *var)
|
2002-01-04 03:32:59 +00:00
|
|
|
{
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_r_easter_eggs_f (easter_eggs);
|
2001-12-11 22:37:30 +00:00
|
|
|
}
|
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2001-12-11 22:37:30 +00:00
|
|
|
R_ParticleFunctionInit (void)
|
|
|
|
{
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_r_particles_style_f (r_particles_style);
|
|
|
|
gl_r_easter_eggs_f (easter_eggs);
|
2001-12-11 22:37:30 +00:00
|
|
|
}
|
|
|
|
|
2012-04-11 13:45:23 +00:00
|
|
|
static void
|
|
|
|
r_particles_nearclip_f (cvar_t *var)
|
|
|
|
{
|
|
|
|
Cvar_SetValue (r_particles_nearclip, bound (r_nearclip->value, var->value,
|
|
|
|
r_farclip->value));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
r_particles_f (cvar_t *var)
|
|
|
|
{
|
|
|
|
R_MaxParticlesCheck (var, r_particles_max);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
r_particles_max_f (cvar_t *var)
|
|
|
|
{
|
|
|
|
R_MaxParticlesCheck (r_particles, var);
|
|
|
|
}
|
|
|
|
|
2012-02-18 13:28:42 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_Particles_Init_Cvars (void)
|
2001-12-11 22:37:30 +00:00
|
|
|
{
|
2012-04-11 13:45:23 +00:00
|
|
|
easter_eggs = Cvar_Get ("easter_eggs", "0", CVAR_NONE, r_easter_eggs_f,
|
|
|
|
"Enables easter eggs.");
|
|
|
|
r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, r_particles_f,
|
|
|
|
"Toggles drawing of particles.");
|
|
|
|
r_particles_max = Cvar_Get ("r_particles_max", "2048", CVAR_ARCHIVE,
|
|
|
|
r_particles_max_f, "Maximum amount of "
|
|
|
|
"particles to display. No maximum, minimum "
|
|
|
|
"is 0.");
|
|
|
|
r_particles_nearclip = Cvar_Get ("r_particles_nearclip", "32",
|
|
|
|
CVAR_ARCHIVE, r_particles_nearclip_f,
|
|
|
|
"Distance of the particle near clipping "
|
|
|
|
"plane from the player.");
|
|
|
|
r_particles_style = Cvar_Get ("r_particles_style", "1", CVAR_ARCHIVE,
|
|
|
|
r_particles_style_f, "Sets particle style. "
|
|
|
|
"0 for Id, 1 for QF.");
|
2001-12-11 22:37:30 +00:00
|
|
|
R_ParticleFunctionInit ();
|
|
|
|
}
|
2007-09-15 04:20:45 +00:00
|
|
|
|
2012-02-18 13:28:42 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
|
|
|
const vec3_t vel, float die, int color, float alpha,
|
|
|
|
float ramp)
|
2007-09-15 04:20:45 +00:00
|
|
|
{
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
particle_new (type, texnum, org, scale, vel, die, color, alpha, ramp);
|
|
|
|
}
|
|
|
|
|
2012-02-18 13:28:42 +00:00
|
|
|
void
|
2012-02-22 07:32:34 +00:00
|
|
|
gl_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
|
|
|
int org_fuzz, float scale, int vel_fuzz, float die,
|
|
|
|
int color, float alpha, float ramp)
|
2007-09-15 04:20:45 +00:00
|
|
|
{
|
|
|
|
if (numparticles >= r_maxparticles)
|
|
|
|
return;
|
|
|
|
particle_new_random (type, texnum, org, org_fuzz, scale, vel_fuzz, die,
|
|
|
|
color, alpha, ramp);
|
|
|
|
}
|