mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-12 04:41:17 +00:00
Merge branch 'fix-fixedrem' into 'next'
Make FixedRem less laggy by just using the modulo operator. See merge request STJr/SRB2!503
This commit is contained in:
commit
91d3f7e2cc
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…
Reference in a new issue