client: reuse combined colors in CL_ColorExplosionParticles

This commit is contained in:
Denis Pauk 2024-09-08 18:36:46 +03:00
parent 7e6e776c6a
commit d48904838e
3 changed files with 7 additions and 7 deletions

View file

@ -2189,7 +2189,7 @@ CL_SmokeTrail(vec3_t start, vec3_t end, int colorStart,
}
void
CL_ForceWall(vec3_t start, vec3_t end, int color8)
CL_ForceWall(vec3_t start, vec3_t end, int color)
{
vec3_t move;
vec3_t vec;
@ -2227,7 +2227,7 @@ CL_ForceWall(vec3_t start, vec3_t end, int color8)
p->alpha = 1.0;
p->alphavel = -1.0f / (3.0 + frandk() * 0.5f);
p->color = VID_PaletteColor(color8);
p->color = color;
for (j = 0; j < 3; j++)
{
@ -2833,7 +2833,7 @@ CL_TagTrail(vec3_t start, vec3_t end, int color)
}
void
CL_ColorExplosionParticles(vec3_t org, int color, int run)
CL_ColorExplosionParticles(vec3_t org, unsigned int basecolor, unsigned int finalcolor)
{
int i;
int j;
@ -2855,7 +2855,7 @@ CL_ColorExplosionParticles(vec3_t org, int color, int run)
active_particles = p;
p->time = time;
p->color = VID_PaletteColor(color + (randk() % run));
p->color = CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0);
for (j = 0; j < 3; j++)
{

View file

@ -1162,7 +1162,7 @@ CL_ParseTEnt(void)
MSG_ReadPos(&net_message, pos);
MSG_ReadPos(&net_message, pos2);
color = MSG_ReadByte(&net_message);
CL_ForceWall(pos, pos2, color);
CL_ForceWall(pos, pos2, VID_PaletteColor(color));
break;
case TE_HEATBEAM:
@ -1229,7 +1229,7 @@ CL_ParseTEnt(void)
case TE_TRACKER_EXPLOSION:
MSG_ReadPos(&net_message, pos);
CL_ColorFlash(pos, 0, 150, -1, -1, -1);
CL_ColorExplosionParticles(pos, 0, 1);
CL_ColorExplosionParticles(pos, 0xff000000, 0xff0f0f0f);
S_StartSound(pos, 0, 0, cl_sfx_disrexp, 1, ATTN_NORM, 0);
break;

View file

@ -412,7 +412,7 @@ void CL_TagTrail (vec3_t start, vec3_t end, int color);
void CL_ColorFlash (vec3_t pos, int ent, float intensity, float r, float g, float b);
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_ColorExplosionParticles (vec3_t org, unsigned int basecolor, unsigned int finalcolor);
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);