diff --git a/include/r_dynamic.h b/include/r_dynamic.h index 98bfabf11..ce8bd24f3 100644 --- a/include/r_dynamic.h +++ b/include/r_dynamic.h @@ -51,7 +51,7 @@ void R_SlightBloodTrail (struct entity_s *ent); void R_GreenTrail (struct entity_s *ent); void R_FlameTrail (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_RunSpikeEffect (vec3_t org, particle_effect_t type); diff --git a/libs/video/renderer/gl/Makefile.am b/libs/video/renderer/gl/Makefile.am index 8ab4ca9a8..73fd552e3 100644 --- a/libs/video/renderer/gl/Makefile.am +++ b/libs/video/renderer/gl/Makefile.am @@ -10,7 +10,7 @@ endif noinst_LTLIBRARIES = $(GL) 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 \ - gl_dyn_textures.c gl_graph.c gl_rmain.c \ +libgl_la_SOURCES = gl_draw.c gl_dyn_fires.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_textures.c gl_warp.c gl_funcs.c noisetextures.c diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index 268d3390a..82ed98cf1 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -255,7 +255,7 @@ R_BloodPuff (vec3_t org, int count) return; 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 @@ -301,11 +301,9 @@ R_RunPuffEffect (vec3_t org, particle_effect_t type, byte count) } 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 k = count; - vec3_t porg; if (numparticles >= r_maxparticles) return; @@ -317,15 +315,14 @@ R_RunParticleEffect (vec3_t org, int color, int count) else scale = 1; - if (numparticles + k >= r_maxparticles) - k = r_maxparticles - numparticles; - count = k; + if (numparticles + count >= r_maxparticles) + count = r_maxparticles - numparticles; for (i = 0; i < count; i++) { 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)), (color & ~7) + (rand () & 7), 255); } diff --git a/libs/video/renderer/sw/sw_rmain.c b/libs/video/renderer/sw/sw_rmain.c index 054477695..f3d299c48 100644 --- a/libs/video/renderer/sw/sw_rmain.c +++ b/libs/video/renderer/sw/sw_rmain.c @@ -457,22 +457,23 @@ R_MarkLeaves (void) static void R_ShowNearestLoc (void) { - location_t *nearloc; - vec3_t trueloc; dlight_t *dl; + location_t *nearloc; + vec3_t trueloc; if (r_drawentities->int_val) return; + nearloc = locs_find (r_origin); if (nearloc) { dl = R_AllocDlight (4096); VectorCopy (nearloc->loc, dl->origin); dl->radius = 200; dl->die = r_realtime + 0.1; - dl->color[1]=1; + dl->color[1] = 1; - VectorCopy(nearloc->loc,trueloc); - R_RunParticleEffect(trueloc,252,10); + VectorCopy(nearloc->loc, trueloc); + R_RunParticleEffect(trueloc, vec3_origin, 252, 10); } } diff --git a/libs/video/renderer/sw/sw_rpart.c b/libs/video/renderer/sw/sw_rpart.c index 7a60007da..07cf01b56 100644 --- a/libs/video/renderer/sw/sw_rpart.c +++ b/libs/video/renderer/sw/sw_rpart.c @@ -125,16 +125,16 @@ R_RunSpikeEffect (vec3_t pos, particle_effect_t type) { switch (type) { case PE_WIZSPIKE: - R_RunParticleEffect (pos, 20, 30); + R_RunParticleEffect (pos, vec3_origin, 20, 30); break; case PE_KNIGHTSPIKE: - R_RunParticleEffect (pos, 226, 20); + R_RunParticleEffect (pos, vec3_origin, 226, 20); break; case PE_SPIKE: - R_RunParticleEffect (pos, 0, 10); + R_RunParticleEffect (pos, vec3_origin, 0, 10); break; case PE_SUPERSPIKE: - R_RunParticleEffect (pos, 0, 20); + R_RunParticleEffect (pos, vec3_origin, 0, 20); break; default: break; @@ -149,13 +149,13 @@ R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt) switch (type) { case PE_GUNSHOT: - R_RunParticleEffect (pos, 0, cnt); + R_RunParticleEffect (pos, vec3_origin, 0, cnt); break; case PE_BLOOD: - R_RunParticleEffect (pos, 73, cnt); + R_RunParticleEffect (pos, vec3_origin, 73, cnt); break; case PE_LIGHTNINGBLOOD: - R_RunParticleEffect (pos, 225, 50); + R_RunParticleEffect (pos, vec3_origin, 225, 50); break; default: break; @@ -265,7 +265,7 @@ R_BlobExplosion (vec3_t org) } 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; particle_t *p; @@ -294,7 +294,7 @@ R_RunParticleEffect (vec3_t org, int color, int count) p->type = pt_grav; for (j = 0; j < 3; j++) { 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; } } } diff --git a/libs/video/renderer/sw32/sw32_rmain.c b/libs/video/renderer/sw32/sw32_rmain.c index 59fb39af6..bf67d0376 100644 --- a/libs/video/renderer/sw32/sw32_rmain.c +++ b/libs/video/renderer/sw32/sw32_rmain.c @@ -486,9 +486,9 @@ R_MarkLeaves (void) static void R_ShowNearestLoc (void) { - location_t *nearloc; - vec3_t trueloc; dlight_t *dl; + location_t *nearloc; + vec3_t trueloc; if (r_drawentities->int_val) return; @@ -498,10 +498,10 @@ R_ShowNearestLoc (void) VectorCopy (nearloc->loc, dl->origin); dl->radius = 200; dl->die = r_realtime + 0.1; - dl->color[1]=1; + dl->color[1] = 1; - VectorCopy(nearloc->loc,trueloc); - R_RunParticleEffect(trueloc,252,10); + VectorCopy(nearloc->loc, trueloc); + R_RunParticleEffect(trueloc, vec3_origin, 252, 10); } } diff --git a/libs/video/renderer/sw32/sw32_rpart.c b/libs/video/renderer/sw32/sw32_rpart.c index b31153a54..9d172419d 100644 --- a/libs/video/renderer/sw32/sw32_rpart.c +++ b/libs/video/renderer/sw32/sw32_rpart.c @@ -125,16 +125,16 @@ R_RunSpikeEffect (vec3_t pos, particle_effect_t type) { switch (type) { case PE_WIZSPIKE: - R_RunParticleEffect (pos, 20, 30); + R_RunParticleEffect (pos, vec3_origin, 20, 30); break; case PE_KNIGHTSPIKE: - R_RunParticleEffect (pos, 226, 20); + R_RunParticleEffect (pos, vec3_origin, 226, 20); break; case PE_SPIKE: - R_RunParticleEffect (pos, 0, 10); + R_RunParticleEffect (pos, vec3_origin, 0, 10); break; case PE_SUPERSPIKE: - R_RunParticleEffect (pos, 0, 20); + R_RunParticleEffect (pos, vec3_origin, 0, 20); break; default: break; @@ -149,13 +149,13 @@ R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt) switch (type) { case PE_GUNSHOT: - R_RunParticleEffect (pos, 0, cnt); + R_RunParticleEffect (pos, vec3_origin, 0, cnt); break; case PE_BLOOD: - R_RunParticleEffect (pos, 73, cnt); + R_RunParticleEffect (pos, vec3_origin, 73, cnt); break; case PE_LIGHTNINGBLOOD: - R_RunParticleEffect (pos, 225, 50); + R_RunParticleEffect (pos, vec3_origin, 225, 50); break; default: break; @@ -265,11 +265,10 @@ R_BlobExplosion (vec3_t org) } 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; - int scale; if (!r_particles->int_val) return; @@ -291,10 +290,10 @@ R_RunParticleEffect (vec3_t org, int color, int count) p->die = r_realtime + 0.1 * (rand () % 5); p->color = (color & ~7) + (rand () & 7); - p->type = pt_grav; + p->type = pt_slowgrav; for (j = 0; j < 3; j++) { 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; } } } diff --git a/nq/source/cl_tent.c b/nq/source/cl_tent.c index 227ff23ab..bbabf0085 100644 --- a/nq/source/cl_tent.c +++ b/nq/source/cl_tent.c @@ -228,7 +228,7 @@ CL_ParseTEnt (void) vec3_t pos; 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 (type == TE_BLOOD) type = TE_EXPLOSION2; @@ -386,14 +386,30 @@ CL_ParseTEnt (void) } else { cnt = MSG_ReadByte (net_message) * 20; } - /* FALLTHROUGH */ - case TE_LIGHTNINGBLOOD: // lightning hitting body 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 + 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: Sys_Error ("CL_ParseTEnt: bad type"); } @@ -497,20 +513,19 @@ CL_UpdateTEnts (void) void CL_ParseParticleEffect (void) { - int i, count, msgcount, color; + int i, count, color; vec3_t org, dir; for (i = 0; i < 3; i++) org[i] = MSG_ReadCoord (net_message); for (i = 0; i < 3; i++) - dir[i] = MSG_ReadChar (net_message) * (1.0 / 16); - msgcount = MSG_ReadByte (net_message); + dir[i] = MSG_ReadChar (net_message) * (15.0 / 16.0); + count = MSG_ReadByte (net_message); color = MSG_ReadByte (net_message); - if (msgcount == 255) - count = 1024; - else - count = msgcount; - - R_RunParticleEffect (org, color, count); + if (count == 255) { + R_ParticleExplosion (org); + } else { + R_RunParticleEffect (org, dir, color, count); + } } diff --git a/qw/source/cl_tent.c b/qw/source/cl_tent.c index c72481a57..46fe533d0 100644 --- a/qw/source/cl_tent.c +++ b/qw/source/cl_tent.c @@ -381,10 +381,27 @@ CL_ParseTEnt (void) case TE_GUNSHOT: // bullet hitting wall case TE_BLOOD: // bullets hitting body 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 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], cnt); break;