X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=r_light.c;h=d0c977d379eb678b18b2704430481800338a9e56;hb=d1986a0cb01eaeab540d54fde3e8a9f8128ce3c2;hp=aafbbf19ceab78314225d63601d4ff6c1c39e9b9;hpb=823d8a2d16635f92223b991cb36ae0104fb6d88e;p=xonotic%2Fdarkplaces.git diff --git a/r_light.c b/r_light.c index aafbbf19..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; @@ -110,6 +113,7 @@ void R_UpdateLights(void) if (!r_dynamic.integer || !cl_dlights) return; + // TODO: optimize to not scan whole cl_dlights array if possible for (i = 0;i < MAX_DLIGHTS;i++) { if (cl_dlights[i].radius > 0) @@ -127,7 +131,7 @@ void R_DrawCoronas(void) int i, lnum; float cscale, scale, viewdist, dist; dlight_t *light; - if (!r_coronas.integer) + if (r_coronas.value < 0.01) return; R_Mesh_Matrix(&r_identitymatrix); viewdist = DotProduct(r_vieworigin, r_viewforward);