Add small cyan light to lightning impacts. And restore particle direction use in nq. Greatly improves blood effects.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-09-27 00:43:46 +00:00
parent 376f05d357
commit 2941c07b0a
9 changed files with 84 additions and 55 deletions

View File

@ -51,7 +51,7 @@ void R_SlightBloodTrail (struct entity_s *ent);
void R_GreenTrail (struct entity_s *ent); void R_GreenTrail (struct entity_s *ent);
void R_FlameTrail (struct entity_s *ent); void R_FlameTrail (struct entity_s *ent);
void R_VoorTrail (struct entity_s *ent); void R_VoorTrail (struct entity_s *ent);
void R_RunParticleEffect (vec3_t org, int color, int count); void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
void R_RunPuffEffect (vec3_t org, particle_effect_t type, byte count); void R_RunPuffEffect (vec3_t org, particle_effect_t type, byte count);
void R_RunSpikeEffect (vec3_t org, particle_effect_t type); void R_RunSpikeEffect (vec3_t org, particle_effect_t type);

View File

@ -10,7 +10,7 @@ endif
noinst_LTLIBRARIES = $(GL) noinst_LTLIBRARIES = $(GL)
libgl_la_LDFLAGS = -version-info 1:0:0 libgl_la_LDFLAGS = -version-info 1:0:0
libgl_la_SOURCES = gl_draw.c gl_dyn_fires.c gl_dyn_part.c gl_dyn_lights.c \ libgl_la_SOURCES = gl_draw.c gl_dyn_fires.c \
gl_dyn_textures.c gl_graph.c gl_rmain.c \ gl_dyn_lights.c gl_dyn_part.c gl_dyn_textures.c gl_graph.c gl_rmain.c \
gl_rmisc.c gl_rsurf.c gl_screen.c gl_skin.c gl_sky.c gl_sky_clip.c \ gl_rmisc.c gl_rsurf.c gl_screen.c gl_skin.c gl_sky.c gl_sky_clip.c \
gl_textures.c gl_warp.c gl_funcs.c noisetextures.c gl_textures.c gl_warp.c gl_funcs.c noisetextures.c

View File

@ -255,7 +255,7 @@ R_BloodPuff (vec3_t org, int count)
return; return;
particle_new (pt_bloodcloud, part_tex_smoke, org, 9, particle_new (pt_bloodcloud, part_tex_smoke, org, 9,
vec3_origin, r_realtime + 99, 68 + (rand () & 3), 128); vec3_origin, r_realtime + 99, 70 + (rand () & 3), 128);
} }
void void
@ -301,11 +301,9 @@ R_RunPuffEffect (vec3_t org, particle_effect_t type, byte count)
} }
void void
R_RunParticleEffect (vec3_t org, int color, int count) R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
{ {
int scale, i, j; int scale, i, j;
int k = count;
vec3_t porg;
if (numparticles >= r_maxparticles) if (numparticles >= r_maxparticles)
return; return;
@ -317,15 +315,14 @@ R_RunParticleEffect (vec3_t org, int color, int count)
else else
scale = 1; scale = 1;
if (numparticles + k >= r_maxparticles) if (numparticles + count >= r_maxparticles)
k = r_maxparticles - numparticles; count = r_maxparticles - numparticles;
count = k;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
porg[j] = org[j] + scale * ((rand () & 15) - 8); org[j] += scale * ((rand () & 15) - 8);
} }
particle_new (pt_grav, part_tex_dot, porg, 1.5, vec3_origin, particle_new (pt_slowgrav, part_tex_dot, org, 1.5, dir,
(r_realtime + 0.1 * (rand () % 5)), (r_realtime + 0.1 * (rand () % 5)),
(color & ~7) + (rand () & 7), 255); (color & ~7) + (rand () & 7), 255);
} }

View File

@ -457,22 +457,23 @@ R_MarkLeaves (void)
static void static void
R_ShowNearestLoc (void) R_ShowNearestLoc (void)
{ {
dlight_t *dl;
location_t *nearloc; location_t *nearloc;
vec3_t trueloc; vec3_t trueloc;
dlight_t *dl;
if (r_drawentities->int_val) if (r_drawentities->int_val)
return; return;
nearloc = locs_find (r_origin); nearloc = locs_find (r_origin);
if (nearloc) { if (nearloc) {
dl = R_AllocDlight (4096); dl = R_AllocDlight (4096);
VectorCopy (nearloc->loc, dl->origin); VectorCopy (nearloc->loc, dl->origin);
dl->radius = 200; dl->radius = 200;
dl->die = r_realtime + 0.1; dl->die = r_realtime + 0.1;
dl->color[1]=1; dl->color[1] = 1;
VectorCopy(nearloc->loc,trueloc); VectorCopy(nearloc->loc, trueloc);
R_RunParticleEffect(trueloc,252,10); R_RunParticleEffect(trueloc, vec3_origin, 252, 10);
} }
} }

View File

@ -125,16 +125,16 @@ R_RunSpikeEffect (vec3_t pos, particle_effect_t type)
{ {
switch (type) { switch (type) {
case PE_WIZSPIKE: case PE_WIZSPIKE:
R_RunParticleEffect (pos, 20, 30); R_RunParticleEffect (pos, vec3_origin, 20, 30);
break; break;
case PE_KNIGHTSPIKE: case PE_KNIGHTSPIKE:
R_RunParticleEffect (pos, 226, 20); R_RunParticleEffect (pos, vec3_origin, 226, 20);
break; break;
case PE_SPIKE: case PE_SPIKE:
R_RunParticleEffect (pos, 0, 10); R_RunParticleEffect (pos, vec3_origin, 0, 10);
break; break;
case PE_SUPERSPIKE: case PE_SUPERSPIKE:
R_RunParticleEffect (pos, 0, 20); R_RunParticleEffect (pos, vec3_origin, 0, 20);
break; break;
default: default:
break; break;
@ -149,13 +149,13 @@ R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt)
switch (type) { switch (type) {
case PE_GUNSHOT: case PE_GUNSHOT:
R_RunParticleEffect (pos, 0, cnt); R_RunParticleEffect (pos, vec3_origin, 0, cnt);
break; break;
case PE_BLOOD: case PE_BLOOD:
R_RunParticleEffect (pos, 73, cnt); R_RunParticleEffect (pos, vec3_origin, 73, cnt);
break; break;
case PE_LIGHTNINGBLOOD: case PE_LIGHTNINGBLOOD:
R_RunParticleEffect (pos, 225, 50); R_RunParticleEffect (pos, vec3_origin, 225, 50);
break; break;
default: default:
break; break;
@ -265,7 +265,7 @@ R_BlobExplosion (vec3_t org)
} }
void void
R_RunParticleEffect (vec3_t org, int color, int count) R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
{ {
int i, j; int i, j;
particle_t *p; particle_t *p;
@ -294,7 +294,7 @@ R_RunParticleEffect (vec3_t org, int color, int count)
p->type = pt_grav; p->type = pt_grav;
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
p->org[j] = org[j] + scale * ((rand () & 15) - 8); p->org[j] = org[j] + scale * ((rand () & 15) - 8);
p->vel[j] = vec3_origin[j]; // + (rand()%300)-150; p->vel[j] = dir[j]; // + (rand()%300)-150;
} }
} }
} }

View File

@ -486,9 +486,9 @@ R_MarkLeaves (void)
static void static void
R_ShowNearestLoc (void) R_ShowNearestLoc (void)
{ {
dlight_t *dl;
location_t *nearloc; location_t *nearloc;
vec3_t trueloc; vec3_t trueloc;
dlight_t *dl;
if (r_drawentities->int_val) if (r_drawentities->int_val)
return; return;
@ -498,10 +498,10 @@ R_ShowNearestLoc (void)
VectorCopy (nearloc->loc, dl->origin); VectorCopy (nearloc->loc, dl->origin);
dl->radius = 200; dl->radius = 200;
dl->die = r_realtime + 0.1; dl->die = r_realtime + 0.1;
dl->color[1]=1; dl->color[1] = 1;
VectorCopy(nearloc->loc,trueloc); VectorCopy(nearloc->loc, trueloc);
R_RunParticleEffect(trueloc,252,10); R_RunParticleEffect(trueloc, vec3_origin, 252, 10);
} }
} }

View File

@ -125,16 +125,16 @@ R_RunSpikeEffect (vec3_t pos, particle_effect_t type)
{ {
switch (type) { switch (type) {
case PE_WIZSPIKE: case PE_WIZSPIKE:
R_RunParticleEffect (pos, 20, 30); R_RunParticleEffect (pos, vec3_origin, 20, 30);
break; break;
case PE_KNIGHTSPIKE: case PE_KNIGHTSPIKE:
R_RunParticleEffect (pos, 226, 20); R_RunParticleEffect (pos, vec3_origin, 226, 20);
break; break;
case PE_SPIKE: case PE_SPIKE:
R_RunParticleEffect (pos, 0, 10); R_RunParticleEffect (pos, vec3_origin, 0, 10);
break; break;
case PE_SUPERSPIKE: case PE_SUPERSPIKE:
R_RunParticleEffect (pos, 0, 20); R_RunParticleEffect (pos, vec3_origin, 0, 20);
break; break;
default: default:
break; break;
@ -149,13 +149,13 @@ R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt)
switch (type) { switch (type) {
case PE_GUNSHOT: case PE_GUNSHOT:
R_RunParticleEffect (pos, 0, cnt); R_RunParticleEffect (pos, vec3_origin, 0, cnt);
break; break;
case PE_BLOOD: case PE_BLOOD:
R_RunParticleEffect (pos, 73, cnt); R_RunParticleEffect (pos, vec3_origin, 73, cnt);
break; break;
case PE_LIGHTNINGBLOOD: case PE_LIGHTNINGBLOOD:
R_RunParticleEffect (pos, 225, 50); R_RunParticleEffect (pos, vec3_origin, 225, 50);
break; break;
default: default:
break; break;
@ -265,11 +265,10 @@ R_BlobExplosion (vec3_t org)
} }
void void
R_RunParticleEffect (vec3_t org, int color, int count) R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
{ {
int i, j; int scale, i, j;
particle_t *p; particle_t *p;
int scale;
if (!r_particles->int_val) if (!r_particles->int_val)
return; return;
@ -291,10 +290,10 @@ R_RunParticleEffect (vec3_t org, int color, int count)
p->die = r_realtime + 0.1 * (rand () % 5); p->die = r_realtime + 0.1 * (rand () % 5);
p->color = (color & ~7) + (rand () & 7); p->color = (color & ~7) + (rand () & 7);
p->type = pt_grav; p->type = pt_slowgrav;
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
p->org[j] = org[j] + scale * ((rand () & 15) - 8); p->org[j] = org[j] + scale * ((rand () & 15) - 8);
p->vel[j] = vec3_origin[j]; // + (rand()%300)-150; p->vel[j] = dir[j]; // + (rand()%300)-150;
} }
} }
} }

View File

@ -228,7 +228,7 @@ CL_ParseTEnt (void)
vec3_t pos; vec3_t pos;
type = MSG_ReadByte (net_message); type = MSG_ReadByte (net_message);
//XXX FIXME this is to get around an nq/qw protocol colission //XXX FIXME this is to get around an nq/qw protocol collision
if (1) { if (1) {
if (type == TE_BLOOD) if (type == TE_BLOOD)
type = TE_EXPLOSION2; type = TE_EXPLOSION2;
@ -386,14 +386,30 @@ CL_ParseTEnt (void)
} else { } else {
cnt = MSG_ReadByte (net_message) * 20; cnt = MSG_ReadByte (net_message) * 20;
} }
/* FALLTHROUGH */
case TE_LIGHTNINGBLOOD: // lightning hitting body
pos[0] = MSG_ReadCoord (net_message); pos[0] = MSG_ReadCoord (net_message);
pos[1] = MSG_ReadCoord (net_message); pos[1] = MSG_ReadCoord (net_message);
pos[2] = MSG_ReadCoord (net_message); pos[2] = MSG_ReadCoord (net_message);
R_RunPuffEffect (pos, prot_to_rend[type], cnt); R_RunPuffEffect (pos, prot_to_rend[type], cnt);
break; break;
case TE_LIGHTNINGBLOOD: // lightning hitting body
pos[0] = MSG_ReadCoord (net_message);
pos[1] = MSG_ReadCoord (net_message);
pos[2] = MSG_ReadCoord (net_message);
// light
dl = R_AllocDlight (0);
VectorCopy (pos, dl->origin);
dl->radius = 150;
dl->die = cl.time + 0.1;
dl->decay = 200;
dl->color[0] = 0.25;
dl->color[1] = 0.40;
dl->color[2] = 0.65;
R_RunPuffEffect (pos, prot_to_rend[type], 50);
break;
default: default:
Sys_Error ("CL_ParseTEnt: bad type"); Sys_Error ("CL_ParseTEnt: bad type");
} }
@ -497,20 +513,19 @@ CL_UpdateTEnts (void)
void void
CL_ParseParticleEffect (void) CL_ParseParticleEffect (void)
{ {
int i, count, msgcount, color; int i, count, color;
vec3_t org, dir; vec3_t org, dir;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
org[i] = MSG_ReadCoord (net_message); org[i] = MSG_ReadCoord (net_message);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
dir[i] = MSG_ReadChar (net_message) * (1.0 / 16); dir[i] = MSG_ReadChar (net_message) * (15.0 / 16.0);
msgcount = MSG_ReadByte (net_message); count = MSG_ReadByte (net_message);
color = MSG_ReadByte (net_message); color = MSG_ReadByte (net_message);
if (msgcount == 255) if (count == 255) {
count = 1024; R_ParticleExplosion (org);
else } else {
count = msgcount; R_RunParticleEffect (org, dir, color, count);
}
R_RunParticleEffect (org, color, count);
} }

View File

@ -381,10 +381,27 @@ CL_ParseTEnt (void)
case TE_GUNSHOT: // bullet hitting wall case TE_GUNSHOT: // bullet hitting wall
case TE_BLOOD: // bullets hitting body case TE_BLOOD: // bullets hitting body
cnt = MSG_ReadByte (net_message) * 20; cnt = MSG_ReadByte (net_message) * 20;
pos[0] = MSG_ReadCoord (net_message);
pos[1] = MSG_ReadCoord (net_message);
pos[2] = MSG_ReadCoord (net_message);
R_RunPuffEffect (pos, prot_to_rend[type], cnt);
break;
case TE_LIGHTNINGBLOOD: // lightning hitting body case TE_LIGHTNINGBLOOD: // lightning hitting body
pos[0] = MSG_ReadCoord (net_message); pos[0] = MSG_ReadCoord (net_message);
pos[1] = MSG_ReadCoord (net_message); pos[1] = MSG_ReadCoord (net_message);
pos[2] = MSG_ReadCoord (net_message); pos[2] = MSG_ReadCoord (net_message);
// light
dl = R_AllocDlight (0);
VectorCopy (pos, dl->origin);
dl->radius = 150;
dl->die = cl.time + 0.1;
dl->decay = 200;
dl->color[0] = 0.25;
dl->color[1] = 0.40;
dl->color[2] = 0.65;
R_RunPuffEffect (pos, prot_to_rend[type], cnt); R_RunPuffEffect (pos, prot_to_rend[type], cnt);
break; break;