From 7e6e776c6ae7b7454c6ebab8b39d2a08ec791e2c Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 8 Sep 2024 18:26:46 +0300 Subject: [PATCH] client: reuse combined colors in CL_ParticleSmokeEffect --- src/client/cl_effects.c | 4 ++-- src/client/cl_tempentities.c | 2 +- src/client/header/client.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/cl_effects.c b/src/client/cl_effects.c index 5150e241..5429f47a 100644 --- a/src/client/cl_effects.c +++ b/src/client/cl_effects.c @@ -2875,7 +2875,7 @@ CL_ColorExplosionParticles(vec3_t org, int color, int run) * Like the steam effect, but unaffected by gravity */ void -CL_ParticleSmokeEffect(vec3_t org, vec3_t dir, int color, +CL_ParticleSmokeEffect(vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor, int count, int magnitude) { int i, j; @@ -2901,7 +2901,7 @@ CL_ParticleSmokeEffect(vec3_t org, vec3_t dir, int color, active_particles = p; p->time = time; - p->color = VID_PaletteColor(color + (randk() & 7)); + p->color = CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0); for (j = 0; j < 3; j++) { diff --git a/src/client/cl_tempentities.c b/src/client/cl_tempentities.c index 3fb96294..e6844ae3 100644 --- a/src/client/cl_tempentities.c +++ b/src/client/cl_tempentities.c @@ -1216,7 +1216,7 @@ CL_ParseTEnt(void) dir[1] = 0; dir[2] = 1; MSG_ReadPos(&net_message, pos); - CL_ParticleSmokeEffect(pos, dir, 0, 20, 20); + CL_ParticleSmokeEffect(pos, dir, 0xff000000, 0xff6b6b6b, 20, 20); break; case TE_ELECTRIC_SPARKS: diff --git a/src/client/header/client.h b/src/client/header/client.h index 66e09acd..857c2f1f 100644 --- a/src/client/header/client.h +++ b/src/client/header/client.h @@ -413,7 +413,8 @@ void CL_ColorFlash (vec3_t pos, int ent, float intensity, float r, float g, floa void CL_Tracker_Shell(vec3_t origin); void CL_MonsterPlasma_Shell(vec3_t origin); void CL_ColorExplosionParticles (vec3_t org, int color, int run); -void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude); +void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor, + int count, int magnitude); void CL_Widowbeamout (cl_sustain_t *self); void CL_Nukeblast (cl_sustain_t *self); void CL_WidowSplash (vec3_t org);