mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-12 08:08:02 +00:00
ref: soft: remove unused scale (remnants of r_lightmap_modulate), use integer values for non-interpolated lightstyles
This commit is contained in:
parent
87b204c661
commit
0e91deec19
@ -40,23 +40,23 @@ void GAME_EXPORT CL_RunLightStyles( void )
|
||||
int i, k, flight, clight;
|
||||
float l, lerpfrac, backlerp;
|
||||
float frametime = (gp_cl->time - gp_cl->oldtime);
|
||||
float scale;
|
||||
lightstyle_t *ls;
|
||||
|
||||
if( !WORLDMODEL ) return;
|
||||
if( !WORLDMODEL )
|
||||
return;
|
||||
|
||||
scale = 1.0f;
|
||||
if( !WORLDMODEL->lightdata )
|
||||
{
|
||||
for( i = 0; i < MAX_LIGHTSTYLES; i++ )
|
||||
tr.lightstylevalue[i] = 256 * 256;
|
||||
return;
|
||||
}
|
||||
|
||||
// light animations
|
||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||
for( i = 0; i < MAX_LIGHTSTYLES; i++ )
|
||||
{
|
||||
ls = gEngfuncs.GetLightStyle( i );
|
||||
if( !WORLDMODEL->lightdata )
|
||||
{
|
||||
tr.lightstylevalue[i] = 256 * 256;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !gp_cl->paused && frametime <= 0.1f )
|
||||
ls->time += frametime; // evaluate local time
|
||||
@ -68,18 +68,18 @@ void GAME_EXPORT CL_RunLightStyles( void )
|
||||
|
||||
if( !ls->length )
|
||||
{
|
||||
tr.lightstylevalue[i] = 256 * scale;
|
||||
tr.lightstylevalue[i] = 256;
|
||||
continue;
|
||||
}
|
||||
else if( ls->length == 1 )
|
||||
{
|
||||
// single length style so don't bother interpolating
|
||||
tr.lightstylevalue[i] = ls->map[0] * 22 * scale;
|
||||
tr.lightstylevalue[i] = ( ls->pattern[0] - 'a' ) * 22;
|
||||
continue;
|
||||
}
|
||||
else if( !ls->interp ) // || !CVAR_TO_BOOL( cl_lightstyle_lerping ))
|
||||
{
|
||||
tr.lightstylevalue[i] = ls->map[flight%ls->length] * 22 * scale;
|
||||
tr.lightstylevalue[i] = ( ls->pattern[flight%ls->length] - 'a' ) * 22;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ void GAME_EXPORT CL_RunLightStyles( void )
|
||||
k = ls->map[clight % ls->length];
|
||||
l += (float)( k * 22.0f ) * lerpfrac;
|
||||
|
||||
tr.lightstylevalue[i] = (int)l * scale;
|
||||
tr.lightstylevalue[i] = (int)l;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user