mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-20 18:52:43 +00:00
- eliminate the last 5 Sin calls
This commit is contained in:
parent
312b96fedc
commit
d013e6fbd9
2 changed files with 8 additions and 8 deletions
|
@ -2106,7 +2106,7 @@ void ProcessMotion(void)
|
|||
continue;
|
||||
else
|
||||
pXSector->bobTheta += MulScale(pXSector->bobSpeed, pXSector->busy, 16);
|
||||
int zoff_i = MulScale(Sin(pXSector->bobTheta), pXSector->bobZRange << 8, 30);
|
||||
int zoff_i = int(BobVal(pXSector->bobTheta) * (pXSector->bobZRange << 8));
|
||||
double zoff = zoff_i * zinttoworld;
|
||||
|
||||
BloodSectIterator it(pSector);
|
||||
|
|
|
@ -375,13 +375,13 @@ void viewUpdateDelirium(PLAYER* pPlayer)
|
|||
tilt2 = MulScale(tilt2, powerScale, 16);
|
||||
pitch = MulScale(pitch, powerScale, 16);
|
||||
}
|
||||
int sin2 = Sin(2 * timer) >> 1;
|
||||
int sin3 = Sin(3 * timer) >> 1;
|
||||
gScreenTilt = DAngle::fromBuild(MulScale(sin2 + sin3, tilt1, 30));
|
||||
int sin4 = Sin(4 * timer) >> 1;
|
||||
deliriumTurn = DAngle::fromBuild(MulScale(sin3 + sin4, tilt2, 30));
|
||||
int sin5 = Sin(5 * timer) >> 1;
|
||||
deliriumPitch = MulScale(sin4 + sin5, pitch, 30);
|
||||
double sin2 = BobVal(2 * timer);
|
||||
double sin3 = BobVal(3 * timer);
|
||||
double sin4 = BobVal(4 * timer);
|
||||
double sin5 = BobVal(5 * timer);
|
||||
gScreenTilt = DAngle::fromBuild((sin2 + sin3) * tilt1 * 0.5);
|
||||
deliriumTurn = DAngle::fromBuild((sin3 + sin4) * tilt2 * 0.5);
|
||||
deliriumPitch = int((sin4 + sin5) * pitch * 0.5);
|
||||
return;
|
||||
}
|
||||
gScreenTilt = gScreenTilt.Normalized180();
|
||||
|
|
Loading…
Reference in a new issue