diff --git a/src/m_fixed.h b/src/m_fixed.h index 3f1acd7ae..8f537b328 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -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)