From 94bd45569cac4bfc68da8bc1dc57d1109b2c8213 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 15 Nov 2020 20:54:47 +1100 Subject: [PATCH] - buildutils: Replace `sintable[]` use within SW's input.cpp with `bsin()`/`bcos()`. --- source/sw/src/input.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index 26c007f4f..8c51474d4 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -231,12 +231,13 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput) if (packet) { - auto const ang = pp->angle.ang.asbuild(); + auto const cos = pp->angle.ang.bcos(); + auto const sin = pp->angle.ang.bsin(); *packet = loc; - packet->fvel = mulscale9(loc.fvel, sintable[NORM_ANGLE(ang + 512)]) + mulscale9(loc.svel, sintable[NORM_ANGLE(ang)]); - packet->svel = mulscale9(loc.fvel, sintable[NORM_ANGLE(ang)]) + mulscale9(loc.svel, sintable[NORM_ANGLE(ang + 1536)]); + packet->fvel = mulscale9(loc.fvel, cos) + mulscale9(loc.svel, sin); + packet->svel = mulscale9(loc.fvel, sin) - mulscale9(loc.svel, cos); loc = {}; }