From fd4e1b3b2832782d67d77d97f09dd3156e8d95e4 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 14 Nov 2020 22:19:00 +1100 Subject: [PATCH] - buildutils: Replace `sintable[]` use within Duke's input.cpp with `bsin()`/`bcos()`. --- source/games/duke/src/input.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 20ab0129f..83ace2bdb 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -897,18 +897,12 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) if (packet) { - auto const pPlayer = &ps[myconnectindex]; - auto const ang = pPlayer->angle.ang.asbuild(); + auto cos = p->angle.ang.bcos(); + auto sin = p->angle.ang.bsin(); *packet = loc; - auto fvel = loc.fvel; - auto svel = loc.svel; - packet->fvel = mulscale9(fvel, sintable[(ang + 2560) & 2047]) + - mulscale9(svel, sintable[(ang + 2048) & 2047]) + - pPlayer->fric.x; - packet->svel = mulscale9(fvel, sintable[(ang + 2048) & 2047]) + - mulscale9(svel, sintable[(ang + 1536) & 2047]) + - pPlayer->fric.y; + packet->fvel = mulscale9(loc.fvel, cos) + mulscale9(loc.svel, sin) + p->fric.x; + packet->svel = mulscale9(loc.fvel, sin) - mulscale9(loc.svel, cos) + p->fric.y; loc = {}; } }