From 8d50c8ea47ac1a8d5c60d8966ef2a8002b96082a Mon Sep 17 00:00:00 2001 From: Chris Ison Date: Wed, 14 Nov 2001 21:46:50 +0000 Subject: [PATCH] added cl_surprise cvar for easter eggs --- include/r_cvar.h | 1 + libs/video/renderer/gl/gl_dyn_part.c | 37 ++++++++++++++++++++-------- libs/video/renderer/r_cvar.c | 7 ++++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/include/r_cvar.h b/include/r_cvar.h index f8236f00f..80c765204 100644 --- a/include/r_cvar.h +++ b/include/r_cvar.h @@ -1,5 +1,6 @@ extern struct cvar_s *cl_crossx; extern struct cvar_s *cl_crossy; +extern struct cvar_s *cl_surprise; extern struct cvar_s *cl_verstring; extern struct cvar_s *crosshair; extern struct cvar_s *crosshaircolor; diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index 65b6c172d..b080e170f 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -428,11 +428,20 @@ R_RocketTrail (entity_t *ent) VectorAdd (ent->old_origin, subtract, ent->old_origin); percent = len * origlen; - // Misty-chan's Easter Egg: change color to (rand () & 255) - particle_new (pt_smoke, part_tex_smoke, ent->old_origin, - pscale + percent * 4.0, vec3_origin, - r_realtime + 2.0 - percent * 2.0, 12 + (rand () & 3), - 128 + (rand () & 31) - percent * 100.0); + if (cl_surprise->int_val) + { + particle_new (pt_smoke, part_tex_smoke, ent->old_origin, + pscale + percent * 4.0, vec3_origin, + r_realtime + 2.0 - percent * 2.0, + (rand () & 255), + 128 + (rand () & 31) - percent * 100.0); + } else { + particle_new (pt_smoke, part_tex_smoke, ent->old_origin, + pscale + percent * 4.0, vec3_origin, + r_realtime + 2.0 - percent * 2.0, + 12 + (rand () & 3), + 128 + (rand () & 31) - percent * 100.0); + } if (numparticles >= r_maxparticles) break; len += dist; @@ -463,11 +472,19 @@ R_GrenadeTrail (entity_t *ent) VectorAdd (ent->old_origin, subtract, ent->old_origin); percent = len * origlen; - // Misty-chan's Easter Egg: change color to (rand () & 255) - particle_new (pt_smoke, part_tex_smoke, ent->old_origin, - pscale + percent * 4.0, vec3_origin, - r_realtime + 2.0 - percent * 2.0, (rand () & 3), - 160 + (rand () & 31) - percent * 100.0); + if (cl_surprise->int_val) + { + particle_new (pt_smoke, part_tex_smoke, ent->old_origin, + pscale + percent * 4.0, vec3_origin, + r_realtime + 2.0 - percent * 2.0, + (rand () & 255), + 160 + (rand () & 31) - percent * 100.0); + } else { + particle_new (pt_smoke, part_tex_smoke, ent->old_origin, pscale + percent * 4.0, vec3_origin, + r_realtime + 2.0 - percent * 2.0, + (rand () & 3), + 160 + (rand () & 31) - percent * 100.0); + } if (numparticles >= r_maxparticles) break; len += dist; diff --git a/libs/video/renderer/r_cvar.c b/libs/video/renderer/r_cvar.c index e16de5ef5..5aa7e7d20 100644 --- a/libs/video/renderer/r_cvar.c +++ b/libs/video/renderer/r_cvar.c @@ -44,8 +44,8 @@ static const char rcsid[] = cvar_t *cl_crossx; cvar_t *cl_crossy; cvar_t *cl_max_particles; -cvar_t *cl_verstring; - +cvar_t *cl_surprise; +cvar_t *cl_verstring; cvar_t *crosshair; cvar_t *crosshaircolor; @@ -148,6 +148,7 @@ cl_max_particles_f (cvar_t *var) void R_Init_Cvars (void) { + cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis."); cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, @@ -156,6 +157,8 @@ R_Init_Cvars (void) cl_max_particles_f, "Maximum amount of " "particles to display. No maximum, minimum " "is 0."); + cl_surprise = Cvar_Get ("cl_surprise", "0", CVAR_NONE, NULL, + "Its a surprise, set to 1"); cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, NULL, "Client version string"); crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair "