mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
client: reuse combined colors in CL_GenericParticleEffect
This commit is contained in:
parent
d48904838e
commit
900233ada7
3 changed files with 30 additions and 36 deletions
|
@ -818,8 +818,8 @@ CL_TeleporterParticles(entity_state_t *ent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
unsigned int
|
||||||
CombineColors(unsigned int basecolor, unsigned int finalcolor, float scale)
|
CL_CombineColors(unsigned int basecolor, unsigned int finalcolor, float scale)
|
||||||
{
|
{
|
||||||
int a_beg, b_beg, c_beg, d_beg;
|
int a_beg, b_beg, c_beg, d_beg;
|
||||||
int a_end, b_end, c_end, d_end;
|
int a_end, b_end, c_end, d_end;
|
||||||
|
@ -872,17 +872,17 @@ CL_LogoutEffect(vec3_t org, int type)
|
||||||
|
|
||||||
if (type == MZ_LOGIN)
|
if (type == MZ_LOGIN)
|
||||||
{
|
{
|
||||||
p->color = CombineColors(0xff00ff00, 0xffffffff, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff00ff00, 0xffffffff, (float)(randk() & 7) / 7.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type == MZ_LOGOUT)
|
else if (type == MZ_LOGOUT)
|
||||||
{
|
{
|
||||||
p->color = CombineColors(0xff2b3ba7, 0xff001357, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff2b3ba7, 0xff001357, (float)(randk() & 7) / 7.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p->color = CombineColors(0xff07abff, 0xff002bab, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff07abff, 0xff002bab, (float)(randk() & 7) / 7.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->org[0] = org[0] - 16 + frandk() * 32;
|
p->org[0] = org[0] - 16 + frandk() * 32;
|
||||||
|
@ -924,7 +924,7 @@ CL_ItemRespawnParticles(vec3_t org)
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(0xff2fa75f, 0xffffffff, (float)(randk() & 3) / 3.0);
|
p->color = CL_CombineColors(0xff2fa75f, 0xffffffff, (float)(randk() & 3) / 3.0);
|
||||||
p->org[0] = org[0] + crandk() * 8;
|
p->org[0] = org[0] + crandk() * 8;
|
||||||
p->org[1] = org[1] + crandk() * 8;
|
p->org[1] = org[1] + crandk() * 8;
|
||||||
p->org[2] = org[2] + crandk() * 8;
|
p->org[2] = org[2] + crandk() * 8;
|
||||||
|
@ -964,7 +964,7 @@ CL_ExplosionParticles(vec3_t org)
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(0xff07abff, 0xff002bab, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff07abff, 0xff002bab, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1054,7 +1054,7 @@ CL_BlasterParticles(vec3_t org, vec3_t dir)
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(0xff07abff, 0xff002bab, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff07abff, 0xff002bab, (float)(randk() & 7) / 7.0);
|
||||||
d = randk() & 15;
|
d = randk() & 15;
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
|
@ -1289,7 +1289,7 @@ CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
|
||||||
{
|
{
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.4f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.4f);
|
||||||
p->color = CombineColors(0xff001f9b, 0xff00001b, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff001f9b, 0xff00001b, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1304,7 +1304,7 @@ CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
|
||||||
{
|
{
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.4f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.4f);
|
||||||
p->color = CombineColors(0xff53ffff, 0xff007fef, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff53ffff, 0xff007fef, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1319,7 +1319,7 @@ CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
|
||||||
{
|
{
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
||||||
p->color = CombineColors(0xff3f3f3f, 0xffababab, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff3f3f3f, 0xffababab, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1404,7 +1404,7 @@ CL_RocketTrail(vec3_t start, vec3_t end, centity_t *old)
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
||||||
p->color = CombineColors(0xff27ffff, 0xff0fbfff, (float)(randk() & 3) / 3.0);
|
p->color = CL_CombineColors(0xff27ffff, 0xff0fbfff, (float)(randk() & 3) / 3.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1466,7 +1466,7 @@ CL_RailTrail(vec3_t start, vec3_t end)
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
||||||
p->color = CombineColors(0xff6f5317, 0xff2b1f00, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff6f5317, 0xff2b1f00, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1500,7 +1500,7 @@ CL_RailTrail(vec3_t start, vec3_t end)
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (0.6f + frandk() * 0.2f);
|
p->alphavel = -1.0f / (0.6f + frandk() * 0.2f);
|
||||||
p->color = CombineColors(0xff000000, 0xffebebeb, (float)(randk() & 15) / 15.0);
|
p->color = CL_CombineColors(0xff000000, 0xffebebeb, (float)(randk() & 15) / 15.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1552,7 +1552,7 @@ CL_IonripperTrail(vec3_t start, vec3_t ent)
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->alpha = 0.5;
|
p->alpha = 0.5;
|
||||||
p->alphavel = -1.0f / (0.3f + frandk() * 0.2f);
|
p->alphavel = -1.0f / (0.3f + frandk() * 0.2f);
|
||||||
p->color = CombineColors(0xff0057d3, 0xff002bab, (float)(randk() & 3) / 3.0);
|
p->color = CL_CombineColors(0xff0057d3, 0xff002bab, (float)(randk() & 3) / 3.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1615,7 +1615,7 @@ CL_BubbleTrail(vec3_t start, vec3_t end)
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.2f);
|
||||||
p->color = CombineColors(0xff3f3f3f, 0xffababab, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff3f3f3f, 0xffababab, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1895,7 +1895,7 @@ CL_TrapParticles(entity_t *ent)
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(0xff07abff, 0xff006be3, (float)(randk() & 3) / 3.0);
|
p->color = CL_CombineColors(0xff07abff, 0xff006be3, (float)(randk() & 3) / 3.0);
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (0.3f + (randk() & 7) * 0.02f);
|
p->alphavel = -1.0f / (0.3f + (randk() & 7) * 0.02f);
|
||||||
|
|
||||||
|
@ -1941,7 +1941,7 @@ CL_BFGExplosionParticles(vec3_t org)
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(0xff00ff00, 0xffffffff, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff00ff00, 0xffffffff, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -1985,7 +1985,7 @@ CL_TeleportParticles(vec3_t org)
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(0xff6b6b6b, 0xffdbdbdb, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff6b6b6b, 0xffdbdbdb, (float)(randk() & 7) / 7.0);
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (0.3f + (randk() & 7) * 0.02f);
|
p->alphavel = -1.0f / (0.3f + (randk() & 7) * 0.02f);
|
||||||
|
|
||||||
|
@ -2131,7 +2131,7 @@ CL_DebugTrail(vec3_t start, vec3_t end)
|
||||||
VectorClear(p->vel);
|
VectorClear(p->vel);
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -0.1f;
|
p->alphavel = -0.1f;
|
||||||
p->color = CombineColors(0xff6f5317, 0xff2b1f00, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff6f5317, 0xff2b1f00, (float)(randk() & 7) / 7.0);
|
||||||
VectorCopy(move, p->org);
|
VectorCopy(move, p->org);
|
||||||
VectorAdd(move, vec, move);
|
VectorAdd(move, vec, move);
|
||||||
}
|
}
|
||||||
|
@ -2283,7 +2283,7 @@ CL_BubbleTrail2(vec3_t start, vec3_t end, int dist)
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1 + frandk() * 0.1f);
|
p->alphavel = -1.0f / (1 + frandk() * 0.1f);
|
||||||
p->color = CombineColors(0xff3f3f3f, 0xffababab, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff3f3f3f, 0xffababab, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -2378,7 +2378,7 @@ CL_Heatbeam(vec3_t start, vec3_t forward)
|
||||||
|
|
||||||
p->alpha = 0.5;
|
p->alpha = 0.5;
|
||||||
p->alphavel = -1000.0;
|
p->alphavel = -1000.0;
|
||||||
p->color = CombineColors(0xff0fbfff, 0xff003bb7, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(0xff0fbfff, 0xff003bb7, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -2855,7 +2855,7 @@ CL_ColorExplosionParticles(vec3_t org, unsigned int basecolor, unsigned int fina
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -2901,7 +2901,7 @@ CL_ParticleSmokeEffect(vec3_t org, vec3_t dir, unsigned int basecolor, unsigned
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0);
|
p->color = CL_CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
@ -2951,7 +2951,7 @@ CL_BlasterParticles2(vec3_t org, vec3_t dir, unsigned int basecolor, unsigned in
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
d = (float)(randk() & 15);
|
d = (float)(randk() & 15);
|
||||||
p->color = CombineColors(basecolor, finalcolor, d / 15.0);
|
p->color = CL_CombineColors(basecolor, finalcolor, d / 15.0);
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -243,7 +243,7 @@ CL_AddParticles(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CL_GenericParticleEffect(vec3_t org, vec3_t dir, int color,
|
CL_GenericParticleEffect(vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor,
|
||||||
int count, int numcolors, int dirspread, float alphavel)
|
int count, int numcolors, int dirspread, float alphavel)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -267,15 +267,7 @@ CL_GenericParticleEffect(vec3_t org, vec3_t dir, int color,
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
if (numcolors > 1)
|
p->color = CL_CombineColors(basecolor, finalcolor, (float)(randk() & 7) / 7.0);
|
||||||
{
|
|
||||||
p->color = VID_PaletteColor(color + (randk() & numcolors));
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p->color = VID_PaletteColor(color);
|
|
||||||
}
|
|
||||||
|
|
||||||
d = (float)(randk() & dirspread);
|
d = (float)(randk() & dirspread);
|
||||||
|
|
||||||
|
|
|
@ -402,7 +402,8 @@ void CL_SmokeTrail (vec3_t start, vec3_t end, int colorStart, int colorRun, int
|
||||||
void CL_Flashlight (int ent, vec3_t pos);
|
void CL_Flashlight (int ent, vec3_t pos);
|
||||||
void CL_ForceWall (vec3_t start, vec3_t end, int color);
|
void CL_ForceWall (vec3_t start, vec3_t end, int color);
|
||||||
void CL_FlameEffects (centity_t *ent, vec3_t origin);
|
void CL_FlameEffects (centity_t *ent, vec3_t origin);
|
||||||
void CL_GenericParticleEffect (vec3_t org, vec3_t dir, int color, int count, int numcolors, int dirspread, float alphavel);
|
void CL_GenericParticleEffect (vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor,
|
||||||
|
int count, int numcolors, int dirspread, float alphavel);
|
||||||
void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist);
|
void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist);
|
||||||
void CL_Heatbeam (vec3_t start, vec3_t end);
|
void CL_Heatbeam (vec3_t start, vec3_t end);
|
||||||
void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude);
|
void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude);
|
||||||
|
@ -415,6 +416,7 @@ void CL_MonsterPlasma_Shell(vec3_t origin);
|
||||||
void CL_ColorExplosionParticles (vec3_t org, unsigned int basecolor, unsigned int finalcolor);
|
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,
|
void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, unsigned int basecolor, unsigned int finalcolor,
|
||||||
int count, int magnitude);
|
int count, int magnitude);
|
||||||
|
unsigned int CL_CombineColors(unsigned int basecolor, unsigned int finalcolor, float scale);
|
||||||
void CL_Widowbeamout (cl_sustain_t *self);
|
void CL_Widowbeamout (cl_sustain_t *self);
|
||||||
void CL_Nukeblast (cl_sustain_t *self);
|
void CL_Nukeblast (cl_sustain_t *self);
|
||||||
void CL_WidowSplash (vec3_t org);
|
void CL_WidowSplash (vec3_t org);
|
||||||
|
|
Loading…
Reference in a new issue