convert fixed to float with multiplication instead of division

This commit is contained in:
Alug committed 2025-04-12 15:43:17 +02:00
1 parent 4be2c84df0
commit 6ff76802eb
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)