- cleanup of m_fixed.h.
With fixed point math barely being used anywhere with the vast majority of calls in the software voxel drawer it makes sense to reduce the function interface to the minimum possible and move the shift value into the function call as an argument.
This commit is contained in:
parent
a2b8ad79ed
commit
58d8ce1a4f
9 changed files with 58 additions and 79 deletions
|
|
@ -9050,15 +9050,19 @@ scriptwait:
|
|||
break;
|
||||
|
||||
case PCD_FIXEDMUL:
|
||||
STACK(2) = FixedMul (STACK(2), STACK(1));
|
||||
STACK(2) = MulScale(STACK(2), STACK(1), 16);
|
||||
sp--;
|
||||
break;
|
||||
|
||||
case PCD_FIXEDDIV:
|
||||
STACK(2) = FixedDiv (STACK(2), STACK(1));
|
||||
{
|
||||
int a = STACK(2), b = STACK(1);
|
||||
// Overflow check.
|
||||
if ((uint32_t)abs(a) >> (31 - 16) >= (uint32_t)abs(b)) STACK(2) = (a ^ b) < 0 ? FIXED_MIN : FIXED_MAX;
|
||||
else STACK(2) = DivScale(STACK(2), STACK(1), 16);
|
||||
sp--;
|
||||
break;
|
||||
|
||||
}
|
||||
case PCD_SETGRAVITY:
|
||||
Level->gravity = ACSToDouble(STACK(1));
|
||||
sp--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue