convert fixed to float with multiplication instead of division

This commit is contained in:
Alug committed 2025-04-12 19:42:27 +02:00
1 parent 94eebd2cd0
commit fb15cfe9f0
1 file changed
+3 -1
+3 -1
View File
@@ -39,9 +39,11 @@ typedef UINT32 ufixed_t;
\brief convert fixed_t into floating number
*/
static const float FLOATUNIT = (1.0f / (float)FRACUNIT);
FUNCMATH FUNCINLINE static ATTRINLINE float FixedToFloat(fixed_t x)
{
return x / (float)FRACUNIT;
return x * FLOATUNIT;
}
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)