In gl_rlight.c find function void R_AnimateLight (void)
And change content to: { int j, k; float l; int flight; int clight; float lerpfrac; float backlerp; extern cvar_t r_interpolate_light;
// light animations //mh //mhquake // 'm' is normal light, 'a' is no light, 'z' is double bright flight = (int) floor (cl.time * 10); clight = (int) ceil (cl.time * 10); lerpfrac = (cl.time * 10) - flight; backlerp = 1.0f - lerpfrac;
for (j = 0; j < MAX_LIGHTSTYLES; j++) { if (!cl_lightstyle.length) { // was 256, changed to 264 for consistency d_lightstylevalue = 264; continue; } else if (cl_lightstyle.length == 1) { // single length style so don't bother interpolating d_lightstylevalue = 22 * (cl_lightstyle.map - 'a'); continue; }
if (1/*r_interpolate_light.value*/) { // interpolate animating light // frame just gone k = flight % cl_lightstyle.length; k = cl_lightstyle.map - 'a'; l = (float) (k * 22) * backlerp;
// upcoming frame k = clight % cl_lightstyle.length; k = cl_lightstyle.map - 'a'; l += (float) (k * 22) * lerpfrac;
d_lightstylevalue = (int) l; } else { k = flight % cl_lightstyle.length; k = cl_lightstyle.map - 'a'; k = k * 22; d_lightstylevalue = k; } } }
Log in to post a comment.
In gl_rlight.c find function
void R_AnimateLight (void)
And change content to:
{
int j, k;
float l;
int flight;
int clight;
float lerpfrac;
float backlerp;
extern cvar_t r_interpolate_light;
// light animations //mh //mhquake
// 'm' is normal light, 'a' is no light, 'z' is double bright
flight = (int) floor (cl.time * 10);
clight = (int) ceil (cl.time * 10);
lerpfrac = (cl.time * 10) - flight;
backlerp = 1.0f - lerpfrac;
for (j = 0; j < MAX_LIGHTSTYLES; j++)
{
if (!cl_lightstyle.length)
{
// was 256, changed to 264 for consistency
d_lightstylevalue = 264;
continue;
}
else if (cl_lightstyle.length == 1)
{
// single length style so don't bother interpolating
d_lightstylevalue = 22 * (cl_lightstyle.map - 'a');
continue;
}
if (1/*r_interpolate_light.value*/)
{
// interpolate animating light
// frame just gone
k = flight % cl_lightstyle.length;
k = cl_lightstyle.map - 'a';
l = (float) (k * 22) * backlerp;
// upcoming frame
k = clight % cl_lightstyle.length;
k = cl_lightstyle.map - 'a';
l += (float) (k * 22) * lerpfrac;
d_lightstylevalue = (int) l;
}
else
{
k = flight % cl_lightstyle.length;
k = cl_lightstyle.map - 'a';
k = k * 22;
d_lightstylevalue = k;
}
}
}