From 1d8de9a89ab74384caa6d11e88115f76268598ae Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 8 Sep 2024 18:20:04 +0300 Subject: [PATCH] client: reuse combined colors in CL_BlasterParticles2 --- src/client/cl_effects.c | 4 ++-- src/client/cl_tempentities.c | 4 ++-- src/client/header/client.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/cl_effects.c b/src/client/cl_effects.c index 13acf1d7..5150e241 100644 --- a/src/client/cl_effects.c +++ b/src/client/cl_effects.c @@ -2925,7 +2925,7 @@ CL_ParticleSmokeEffect(vec3_t org, vec3_t dir, int color, * Wall impact puffs (Green) */ void -CL_BlasterParticles2(vec3_t org, vec3_t dir, unsigned int color) +CL_BlasterParticles2(vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor) { int i, j; cparticle_t *p; @@ -2950,8 +2950,8 @@ CL_BlasterParticles2(vec3_t org, vec3_t dir, unsigned int color) active_particles = p; p->time = time; - p->color = VID_PaletteColor(color + (randk() & 7)); d = (float)(randk() & 15); + p->color = CombineColors(basecolor, finalcolor, d / 15.0); for (j = 0; j < 3; j++) { diff --git a/src/client/cl_tempentities.c b/src/client/cl_tempentities.c index e5ef4bbd..3fb96294 100644 --- a/src/client/cl_tempentities.c +++ b/src/client/cl_tempentities.c @@ -1053,11 +1053,11 @@ CL_ParseTEnt(void) if (type == TE_BLASTER2) { - CL_BlasterParticles2(pos, dir, 0xd0); + CL_BlasterParticles2(pos, dir, 0xff00ff00, 0xffffffff); } else { - CL_BlasterParticles2(pos, dir, 0x6f); + CL_BlasterParticles2(pos, dir, 0xffb7a787, 0xff5b430f); } ex = CL_AllocExplosion(); diff --git a/src/client/header/client.h b/src/client/header/client.h index 8468c29d..66e09acd 100644 --- a/src/client/header/client.h +++ b/src/client/header/client.h @@ -395,7 +395,7 @@ void CL_FlagTrail (vec3_t start, vec3_t end, int color); void CL_IonripperTrail (vec3_t start, vec3_t end); -void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int color); +void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor); void CL_BlasterTrail2 (vec3_t start, vec3_t end); void CL_DebugTrail (vec3_t start, vec3_t end); void CL_SmokeTrail (vec3_t start, vec3_t end, int colorStart, int colorRun, int spacing);