From ec327370c5506f6f31adbca2eff03e0e2de467cb Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 14 Feb 2003 01:22:29 +0000 Subject: [PATCH] fix some bugs with r_fullbright, no lights, and other such cases git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2740 d7cf8633-e32d-0410-b094-e92efae38249 --- r_light.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/r_light.c b/r_light.c index 48ef2cdd..7aea7676 100644 --- a/r_light.c +++ b/r_light.c @@ -656,7 +656,7 @@ void R_ModelLightPoint (const entity_render_t *ent, vec3_t color, const vec3_t p { mleaf_t *leaf; leaf = Mod_PointInLeaf(p, cl.worldmodel); - if (!leaf || leaf->contents == CONTENTS_SOLID || r_fullbright.integer || !cl.worldmodel->lightdata || ent->effects & EF_FULLBRIGHT) + if (!leaf || leaf->contents == CONTENTS_SOLID || !cl.worldmodel->lightdata) { color[0] = color[1] = color[2] = 1; return; @@ -691,7 +691,11 @@ void R_LightModel(const entity_render_t *ent, int numverts, float *vertices, flo // scale of the model's coordinate space, to alter light attenuation to match // make the mscale squared so it can scale the squared distance results mscale = ent->scale * ent->scale; - if ((maxnearlights != 0) && !r_fullbright.integer && !(ent->effects & EF_FULLBRIGHT)) + if (r_fullbright.integer || (ent->effects & EF_FULLBRIGHT)) + VectorSet(basecolor, 1, 1, 1); + else if (maxnearlights == 0 && r_shadow_lightingmode < 2) + R_CompleteLightPoint (basecolor, ent->origin, true, NULL); + else { R_ModelLightPoint(ent, basecolor, ent->origin); @@ -824,8 +828,6 @@ void R_LightModel(const entity_render_t *ent, int numverts, float *vertices, flo } } } - else - R_CompleteLightPoint (basecolor, ent->origin, true, NULL); basecolor[0] *= colorr; basecolor[1] *= colorg; basecolor[2] *= colorb; -- 2.39.2