Make FixedRem less laggy by just using the modulo operator.

This commit is contained in:
GoldenTails 2019-07-08 08:39:31 -05:00
parent 96b12f098b
commit e9771cd7d0

View file

@ -206,14 +206,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedDiv(fixed_t a, fixed_t b)
*/ */
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRem(fixed_t x, fixed_t y) FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRem(fixed_t x, fixed_t y)
{ {
const boolean n = x < 0; return x % y;
x = abs(x);
while (x >= y)
x -= y;
if (n)
return -x;
else
return x;
} }
/** \brief The FixedSqrt function /** \brief The FixedSqrt function