From ea22198a52ba1b2b2e4a3ce06a9cdea832b420e7 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Wed, 20 Jul 2005 08:04:46 +0000 Subject: [PATCH] [ 1227382 ] r_explosionlight git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1150 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_tent.c | 87 ++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/engine/client/cl_tent.c b/engine/client/cl_tent.c index 099ba7ebf..681f268e2 100644 --- a/engine/client/cl_tent.c +++ b/engine/client/cl_tent.c @@ -174,6 +174,7 @@ sfx_t *cl_sfx_ric3; sfx_t *cl_sfx_r_exp3; cvar_t cl_expsprite = {"cl_expsprite", "0"}; +cvar_t r_explosionlight = {"r_explosionlight", "1"}; cvar_t cl_truelightning = {"cl_truelightning", "0", NULL, CVAR_SEMICHEAT}; typedef struct { @@ -208,6 +209,7 @@ void CL_InitTEnts (void) Cvar_Register (&cl_expsprite, "Temporary entity control"); Cvar_Register (&cl_truelightning, "Temporary entity control"); + Cvar_Register (&r_explosionlight, "Temporary entity control"); } #ifdef Q2CLIENT @@ -776,19 +778,20 @@ void CL_ParseTEnt (void) P_ParticleExplosion (pos); // light - dl = CL_AllocDlight (0); - VectorCopy (pos, dl->origin); - dl->radius = 350; - dl->die = cl.time + 1; - dl->decay = 300; + if (r_explosionlight.value) { + dl = CL_AllocDlight (0); + VectorCopy (pos, dl->origin); + dl->radius = 150 + bound(0, r_explosionlight.value, 1)*200; + dl->die = cl.time + 1; + dl->decay = 300; - dl->color[0] = 0.2; - dl->color[1] = 0.155; - dl->color[2] = 0.05; - dl->channelfade[0] = 0.196; - dl->channelfade[1] = 0.23; - dl->channelfade[2] = 0.12; - + dl->color[0] = 0.2; + dl->color[1] = 0.155; + dl->color[2] = 0.05; + dl->channelfade[0] = 0.196; + dl->channelfade[1] = 0.23; + dl->channelfade[2] = 0.12; + } // sound @@ -846,18 +849,20 @@ void CL_ParseTEnt (void) P_ParticleExplosion (pos); // light - dl = CL_AllocDlight (0); - VectorCopy (pos, dl->origin); - dl->radius = 350; - dl->die = cl.time + 1; - dl->decay = 700; + if (r_explosionlight.value) { + dl = CL_AllocDlight (0); + VectorCopy (pos, dl->origin); + dl->radius = 150 + bound(0, r_explosionlight.value, 1)*200; + dl->die = cl.time + 0.5; + dl->decay = 300; - dl->color[0] = 0.4f*MSG_ReadByte()/255.0f; - dl->color[1] = 0.4f*MSG_ReadByte()/255.0f; - dl->color[2] = 0.4f*MSG_ReadByte()/255.0f; - dl->channelfade[0] = 0; - dl->channelfade[1] = 0; - dl->channelfade[2] = 0; + dl->color[0] = 0.4f*MSG_ReadByte()/255.0f; + dl->color[1] = 0.4f*MSG_ReadByte()/255.0f; + dl->color[2] = 0.4f*MSG_ReadByte()/255.0f; + dl->channelfade[0] = 0; + dl->channelfade[1] = 0; + dl->channelfade[2] = 0; + } S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1); break; @@ -1661,16 +1666,16 @@ void CLQ2_ParseTEnt (void) P_ParticleExplosion (pos); // light - { + if (r_explosionlight.value) { dlight_t *dl; - dl = CL_AllocDlight (0); - VectorCopy (pos, dl->origin); - dl->radius = 350; - dl->die = cl.time + 0.5; - dl->decay = 300; - dl->color[0] = 0.2; - dl->color[1] = 0.1; - dl->color[2] = 0.1; + dl = CL_AllocDlight (0); + VectorCopy (pos, dl->origin); + dl->radius = 150 + bound(0, r_explosionlight.value, 1)*200; + dl->die = cl.time + 0.5; + dl->decay = 300; + dl->color[0] = 0.2; + dl->color[1] = 0.1; + dl->color[2] = 0.1; } // sound @@ -1747,16 +1752,16 @@ void CLQ2_ParseTEnt (void) P_ParticleExplosion (pos); // light - { + if (r_explosionlight.value) { dlight_t *dl; - dl = CL_AllocDlight (0); - VectorCopy (pos, dl->origin); - dl->radius = 350; - dl->die = cl.time + 0.5; - dl->decay = 300; - dl->color[0] = 0.2; - dl->color[1] = 0.1; - dl->color[2] = 0.08; + dl = CL_AllocDlight (0); + VectorCopy (pos, dl->origin); + dl->radius = 150 + bound(0, r_explosionlight.value, 1)*200; + dl->die = cl.time + 0.5; + dl->decay = 300; + dl->color[0] = 0.2; + dl->color[1] = 0.1; + dl->color[2] = 0.08; } // sound