I am added light style interpolations but i get bug, need your help:
self model start blink with black color when i use tome of power,
"chase_active 1"
"impulse 43"
in console , after use tome of power
in gl_rlight.c i changed this function
void R_AnimateLight (void)
{
int j, k;
float l;
int flight;
int clight;
float lerpfrac;
float backlerp;
extern cvar_t r_interpolate_light;
// light animations
// '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[j].length)
{
// was 256, changed to 264 for consistency
d_lightstylevalue[j] = 264;
continue;
}
else if (cl_lightstyle[j].length == 1)
{
// single length style so don't bother interpolating
d_lightstylevalue[j] = 22 * (cl_lightstyle[j].map[0] - 'a');
continue;
}
if (r_interpolate_light.value)
{
// interpolate animating light
// frame just gone
k = flight % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
l = (float) (k * 22) * backlerp;
// upcoming frame
k = clight % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
l += (float) (k * 22) * lerpfrac;
d_lightstylevalue[j] = (int) l;
}
else
{
k = flight % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
k = k * 22;
d_lightstylevalue[j] = k;
}
}
}
self model start blink with black color when i use tome of power,
"chase_active 1"
"impulse 43"
in console , after use tome of power
in gl_rlight.c i changed this function
void R_AnimateLight (void)
{
int j, k;
float l;
int flight;
int clight;
float lerpfrac;
float backlerp;
extern cvar_t r_interpolate_light;
// light animations
// '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[j].length)
{
// was 256, changed to 264 for consistency
d_lightstylevalue[j] = 264;
continue;
}
else if (cl_lightstyle[j].length == 1)
{
// single length style so don't bother interpolating
d_lightstylevalue[j] = 22 * (cl_lightstyle[j].map[0] - 'a');
continue;
}
if (r_interpolate_light.value)
{
// interpolate animating light
// frame just gone
k = flight % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
l = (float) (k * 22) * backlerp;
// upcoming frame
k = clight % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
l += (float) (k * 22) * lerpfrac;
d_lightstylevalue[j] = (int) l;
}
else
{
k = flight % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
k = k * 22;
d_lightstylevalue[j] = k;
}
}
}
Comment