engine: client: gamma: fix gamma when compiled with -ffast-math

This commit is contained in:
Alibek Omarov
2026-04-01 20:35:04 +05:00
parent 2ebaa2ad8e
commit 38b3805ad8

View File

@@ -52,8 +52,9 @@ static void BuildGammaTable( const float gamma, const float brightness, const fl
for( i = 0; i < 256; i++ )
{
double d = pow( i / 255.0, (double)g2 );
int inf = d * 255.0;
// keep it float or texgamma test will fail with -ffast-math
float d = pow( i / 255.0, (double)g2 );
int inf = d * 255.0f;
texgammatable[i] = bound( 0, inf, 255 );
}