|
|
|
@ -37,23 +37,23 @@ void CL_RunLightStyles( void )
@@ -37,23 +37,23 @@ void 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
|
|
|
|
@ -65,18 +65,18 @@ void CL_RunLightStyles( void )
@@ -65,18 +65,18 @@ void 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 || !cl_lightstyle_lerping->flags ) |
|
|
|
|
{ |
|
|
|
|
tr.lightstylevalue[i] = ls->map[flight%ls->length] * 22 * scale; |
|
|
|
|
tr.lightstylevalue[i] = ( ls->pattern[flight%ls->length] - 'a' ) * 22; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ void CL_RunLightStyles( void )
@@ -89,7 +89,7 @@ void 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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|