mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Make FixedRem less laggy by just using the modulo operator.
This commit is contained in:
parent
6bc4d5a086
commit
b283a84ac0
1 changed files with 1 additions and 8 deletions
|
|
@ -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)
|
||||
{
|
||||
const boolean n = x < 0;
|
||||
x = abs(x);
|
||||
while (x >= y)
|
||||
x -= y;
|
||||
if (n)
|
||||
return -x;
|
||||
else
|
||||
return x;
|
||||
return x % y;
|
||||
}
|
||||
|
||||
/** \brief The FixedSqrt function
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue