From: tomaz Date: Tue, 17 Aug 2004 22:50:53 +0000 (+0000) Subject: Added lightstyle interpolation. X-Git-Tag: xonotic-v0.1.0preview~5743 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a153471a6af0a22743801a8e46fcd1f4a94ec0f7;p=xonotic%2Fdarkplaces.git Added lightstyle interpolation. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4334 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_light.c b/r_light.c index c5ec8b2a..d0c977d3 100644 --- a/r_light.c +++ b/r_light.c @@ -86,11 +86,13 @@ R_UpdateLights */ void R_UpdateLights(void) { - int i, j, k; + float frac; + int i, j, k, l; // light animations // 'm' is normal light, 'a' is no light, 'z' is double bright i = (int)(cl.time * 10); + frac = (cl.time * 10) - i; for (j = 0;j < MAX_LIGHTSTYLES;j++) { if (!cl_lightstyle || !cl_lightstyle[j].length) @@ -99,9 +101,10 @@ void R_UpdateLights(void) continue; } k = i % cl_lightstyle[j].length; + l = (i-1) % cl_lightstyle[j].length; k = cl_lightstyle[j].map[k] - 'a'; - k = k*22; - d_lightstylevalue[j] = k; + l = cl_lightstyle[j].map[l] - 'a'; + d_lightstylevalue[j] = ((k*frac)+(l*(1-frac)))*22; } r_numdlights = 0;