From 82c68a482b7ef066b4b701d3be0c542112d8eed0 Mon Sep 17 00:00:00 2001 From: Joseph Carter Date: Wed, 24 May 2000 23:55:43 +0000 Subject: [PATCH] Explosions are temporarily PURPLE, deal with it. Made dlight colors RGB as opposed to RGBA, the alpha doesn't make a whole lot of sense. --- include/client.h | 2 +- source/cl_ents.c | 43 +++++++++++++++++++++++-------------------- source/cl_tent.c | 12 ++++++++---- source/gl_rlight.c | 3 +-- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/include/client.h b/include/client.h index 907bf7b..9118321 100644 --- a/include/client.h +++ b/include/client.h @@ -148,7 +148,7 @@ typedef struct float die; // stop lighting after this time float decay; // drop this each second float minlight; // don't add when contributing less - float color[4]; + float color[3]; // Don't use alpha --KB } dlight_t; typedef struct diff --git a/source/cl_ents.c b/source/cl_ents.c index 50385ec..0e56827 100644 --- a/source/cl_ents.c +++ b/source/cl_ents.c @@ -118,26 +118,29 @@ void CL_NewDlight (int key, float x, float y, float z, float radius, float time, dl->origin[2] = z; dl->radius = radius; dl->die = cl.time + time; - if (type == 0) { - dl->color[0] = 0.2; - dl->color[1] = 0.1; - dl->color[2] = 0.05; - dl->color[3] = 0.7; - } else if (type == 1) { - dl->color[0] = 0.05; - dl->color[1] = 0.05; - dl->color[2] = 0.3; - dl->color[3] = 0.7; - } else if (type == 2) { - dl->color[0] = 0.5; - dl->color[1] = 0.05; - dl->color[2] = 0.05; - dl->color[3] = 0.7; - } else if (type == 3) { - dl->color[0]=0.5; - dl->color[1] = 0.05; - dl->color[2] = 0.4; - dl->color[3] = 0.7; + switch (type) + { + default: + case 0: + dl->color[0] = 0.2; + dl->color[1] = 0.1; + dl->color[2] = 0.05; + break; + case 1: // blue + dl->color[0] = 0.05; + dl->color[1] = 0.05; + dl->color[2] = 0.3; + break; + case 2: // red + dl->color[0] = 0.5; + dl->color[1] = 0.05; + dl->color[2] = 0.05; + break; + case 3: // purple + dl->color[0] = 0.5; + dl->color[1] = 0.05; + dl->color[2] = 0.4; + break; } } diff --git a/source/cl_tent.c b/source/cl_tent.c index b95ea77..df73127 100644 --- a/source/cl_tent.c +++ b/source/cl_tent.c @@ -259,10 +259,14 @@ void CL_ParseTEnt (void) 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.05; - dl->color[3] = 0.7; +// dl->color[0] = 0.2; +// dl->color[1] = 0.1; +// dl->color[2] = 0.05; +// dl->color[3] = 0.7; + dl->color[0] = 0.8; + dl->color[1] = 0.2; + dl->color[2] = 0.8; + dl->color[3] = 1; // sound S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1); diff --git a/source/gl_rlight.c b/source/gl_rlight.c index a7a7539..dafe874 100644 --- a/source/gl_rlight.c +++ b/source/gl_rlight.c @@ -147,8 +147,7 @@ void R_RenderDlight (dlight_t *light) glBegin (GL_TRIANGLE_FAN); // glColor3f (0.2,0.1,0.0); // glColor3f (0.2,0.1,0.05); // changed dimlight effect - glColor4f (light->color[0], light->color[1], light->color[2], - light->color[3]); + glColor3fv (light->color); for (i=0 ; i<3 ; i++) v[i] = light->origin[i] - vpn[i]*rad; glVertex3fv (v);