mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-14 13:10:09 +01:00
public: mathlib: convert FloatToHalf and HalfToFloat to use float_bits_t union
This commit is contained in:
parent
412c635499
commit
b96bfcfe7a
@ -73,7 +73,7 @@ float SimpleSpline( float value )
|
||||
|
||||
word FloatToHalf( float v )
|
||||
{
|
||||
unsigned int i = *((unsigned int *)&v);
|
||||
unsigned int i = FloatAsUint( v );
|
||||
unsigned int e = (i >> 23) & 0x00ff;
|
||||
unsigned int m = i & 0x007fffff;
|
||||
unsigned short h;
|
||||
@ -115,7 +115,7 @@ float HalfToFloat( word h )
|
||||
}
|
||||
}
|
||||
|
||||
return *((float *)&f);
|
||||
return UintAsFloat( f );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user