From: havoc Date: Thu, 31 Jul 2003 00:16:05 +0000 (+0000) Subject: simplified dlight fading code X-Git-Tag: xonotic-v0.1.0preview~6467 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2d4296949ff91a36f212e375fffac6a5d18d80dc;p=xonotic%2Fdarkplaces.git simplified dlight fading code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3350 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_main.c b/cl_main.c index eff73786..18503b6e 100644 --- a/cl_main.c +++ b/cl_main.c @@ -456,22 +456,9 @@ void CL_DecayLights(void) float time; time = cl.time - cl.oldtime; - - dl = cl_dlights; - for (i=0 ; iradius) - continue; - if (dl->die < cl.time) - { - dl->radius = 0; - continue; - } - - dl->radius -= time*dl->decay; - if (dl->radius < 0) - dl->radius = 0; - } + for (i = 0, dl = cl_dlights;i < MAX_DLIGHTS;i++, dl++) + if (dl->radius) + dl->radius = (cl.time < dl->die) ? max(0, dl->radius - time * dl->decay) : 0; } extern qboolean Nehahrademcompatibility;