mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
engine: client: use alternative ease-in ease-out function in sound fade
This commit is contained in:
parent
7cac1d290d
commit
53987f47e2
@ -159,7 +159,7 @@ void S_UpdateSoundFade( void )
|
||||
}
|
||||
|
||||
// spline it.
|
||||
f = SimpleSpline( f );
|
||||
f = -( cos( M_PI * f ) - 1 ) / 2;
|
||||
f = bound( 0.0f, f, 1.0f );
|
||||
|
||||
soundfade.percent = soundfade.initial_percent * f;
|
||||
|
@ -53,24 +53,6 @@ float anglemod( float a )
|
||||
return a;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
SimpleSpline
|
||||
|
||||
NOTE: ripped from hl2 source
|
||||
hermite basis function for smooth interpolation
|
||||
Similar to Gain() above, but very cheap to call
|
||||
value should be between 0 & 1 inclusive
|
||||
=================
|
||||
*/
|
||||
float SimpleSpline( float value )
|
||||
{
|
||||
float valueSquared = value * value;
|
||||
|
||||
// nice little ease-in, ease-out spline-like curve
|
||||
return (3.0f * valueSquared - 2.0f * valueSquared * value);
|
||||
}
|
||||
|
||||
word FloatToHalf( float v )
|
||||
{
|
||||
unsigned int i = FloatAsUint( v );
|
||||
|
@ -177,7 +177,6 @@ float rsqrt( float number );
|
||||
float anglemod( float a );
|
||||
word FloatToHalf( float v );
|
||||
float HalfToFloat( word h );
|
||||
float SimpleSpline( float value );
|
||||
void RoundUpHullSize( vec3_t size );
|
||||
int SignbitsForPlane( const vec3_t normal );
|
||||
int PlaneTypeForNormal( const vec3_t normal );
|
||||
|
Loading…
x
Reference in New Issue
Block a user