convert fixed to float with multiplication instead of division
This commit is contained in:
1 parent
4be2c84df0
commit
6ff76802eb
1 file changed
+3
-1
+3
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user