1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 12:06:07 +08:00

dota: Correct V_clamp usage

This commit is contained in:
GAMMACASE
2025-07-31 18:41:56 +03:00
parent a4be8ce51f
commit 9bada9018f

View File

@ -1144,7 +1144,7 @@ inline float SimpleSplineRemapValClamped( float val, float A, float B, float C,
if ( A == B )
return val >= B ? D : C;
float cVal = (val - A) / (B - A);
cVal = V_clamp( cVal, 0.0f, 1.0f );
cVal = clamp( cVal, 0.0f, 1.0f );
return C + (D - C) * SimpleSpline( cVal );
}
@ -2097,7 +2097,7 @@ FORCEINLINE void RGB2YUV( int &nR, int &nG, int &nB, float &fY, float &fU, float
dX = 2*( fU - 0.5f );
dY = 2*( fV - 0.5f );
sat = sqrtf( dX*dX + dY*dY );
sat = V_clamp( ( sat*( 1 + SNAP_TO_GREY ) - SNAP_TO_GREY ), 0, 1 );
sat = clamp( ( sat*( 1 + SNAP_TO_GREY ) - SNAP_TO_GREY ), 0, 1 );
scale = ( sat == 0 ) ? 0 : MIN( ( sqrtf( sat ) / sat ), 4.0f );
fU = 0.5f + scale*( fU - 0.5f );
fV = 0.5f + scale*( fV - 0.5f );