Prettier, but slower particle effects. Also skip particle physics when r_particles 0.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-09-05 02:04:02 +00:00
parent 2e1a5112bd
commit 75aaccf9f0
3 changed files with 31 additions and 33 deletions

View file

@ -68,8 +68,6 @@ typedef struct particle_s
{
// driver-usable fields
vec3_t org;
vec3_t up;
vec3_t right;
int tex;
float color;
float alpha;

View file

@ -53,19 +53,17 @@
// !!! if this is changed, it must be changed in d_iface.h too !!!
// driver-usable fields
#define pt_org 0
#define pt_up 12
#define pt_right 24
#define pt_tex 36
#define pt_color 40
#define pt_alpha 44
#define pt_scale 48
#define pt_tex 12
#define pt_color 16
#define pt_alpha 20
#define pt_scale 24
// drivers never touch the following fields
#define pt_next 52
#define pt_vel 56
#define pt_ramp 60
#define pt_die 64
#define pt_type 68
#define pt_size 72
#define pt_next 28
#define pt_vel 32
#define pt_ramp 36
#define pt_die 40
#define pt_type 44
#define pt_size 48
#define PARTICLE_Z_CLIP 8.0

View file

@ -446,26 +446,25 @@ R_RocketTrail (int type, entity_t *ent)
ptype = pt_static;
palpha = 255;
pcolor = 0;
pscale = pscalenext = 3;
pscale = pscalenext = 4.5;
dist = 3;
switch (type) {
case 0: // rocket trail
pdie = r_realtime + 0.4;
pscale = lhrandom (1, 2);
pscale = lhrandom (1.5, 3);
ptype = pt_smoke;
break;
case 1: // grenade trail
pscale = lhrandom (4, 9);
pscale = lhrandom (6, 13);
ptype = pt_smoke;
break;
case 2: // blood
pscale = lhrandom (4, 10);
pscale = lhrandom (5, 15);
ptype = pt_grav;
break;
case 4: // slight blood
palpha = 192;
pdie = r_realtime + 1.3;
pscale = lhrandom (1, 6);
pdie = r_realtime + 1.5;
pscale = lhrandom (1.5, 9);
ptype = pt_grav;
break;
case 3: // green tracer
@ -488,8 +487,8 @@ R_RocketTrail (int type, entity_t *ent)
switch (type) {
case 0: // rocket trail
pscalenext = lhrandom (1, 2);
dist = (pscale + pscalenext) * 4;
pscalenext = lhrandom (1.5, 3);
dist = (pscale + pscalenext) * 1.3;
// pcolor = (rand () & 255); // Misty-chan's Easter Egg
pcolor = (rand () & 3) + 12;
palpha = 128 + (rand () & 31);
@ -500,8 +499,8 @@ R_RocketTrail (int type, entity_t *ent)
ptex = part_tex_smoke[rand () & 7];
break;
case 1: // grenade trail
pscalenext = lhrandom (4, 9);
dist = (pscale + pscalenext) * 4;
pscalenext = lhrandom (6, 13);
dist = (pscale + pscalenext) * 2;
// pcolor = (rand () & 255); // Misty-chan's Easter Egg
pcolor = (rand () & 3);
palpha = 128 + (rand () & 31);
@ -509,8 +508,8 @@ R_RocketTrail (int type, entity_t *ent)
ptex = part_tex_smoke[rand () & 7];
break;
case 2: // blood
pscalenext = lhrandom (4, 10);
dist = (pscale + pscalenext) * 4;
pscalenext = lhrandom (5, 15);
dist = (pscale + pscalenext) * 1.5;
ptex = part_tex_smoke[rand () & 7];
pcolor = 68 + (rand () & 3);
for (j = 0; j < 3; j++) {
@ -519,8 +518,8 @@ R_RocketTrail (int type, entity_t *ent)
}
break;
case 4: // slight blood
pscalenext = lhrandom (1, 6);
dist = (pscale + pscalenext) * 4;
pscalenext = lhrandom (1.5, 9);
dist = (pscale + pscalenext) * 1.5;
ptex = part_tex_smoke[rand () & 7];
pcolor = 68 + (rand () & 3);
for (j = 0; j < 3; j++) {
@ -534,7 +533,7 @@ R_RocketTrail (int type, entity_t *ent)
static int tracercount;
ptex = part_tex_smoke[rand () & 7];
pscale = lhrandom (1, 2);
pscale = lhrandom (2, 3);
if (type == 3)
pcolor = 52 + ((tracercount & 4) << 1);
else
@ -554,7 +553,7 @@ R_RocketTrail (int type, entity_t *ent)
break;
case 6: // voor trail
pcolor = 9 * 16 + 8 + (rand () & 3);
pscale = lhrandom (.75, 1.5);
pscale = lhrandom (1, 2);
for (j = 0; j < 3; j++)
porg[j] = ent->old_origin[j] + lhrandom (-8, 8);
break;
@ -580,11 +579,14 @@ R_DrawParticles (void)
vec3_t up, right;
vec3_t up_scale, right_scale, up_right_scale, down_right_scale;
if (!r_particles->int_val)
return;
// LordHavoc: particles should not affect zbuffer
qfglDepthMask (GL_FALSE);
VectorScale (vup, 1.5, up);
VectorScale (vright, 1.5, right);
VectorCopy (vup, up);
VectorCopy (vright, right);
varray[0].texcoord[0] = 0; varray[0].texcoord[1] = 1;
varray[1].texcoord[0] = 0; varray[1].texcoord[1] = 0;