From 46a12cf58a1cf8d49a74bc06b684f38177752b8d Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 6 Sep 2020 21:47:00 +1000 Subject: [PATCH] - SW: Clean up `gi->GetInput()` by removing some unneeded local variables. --- source/sw/src/input.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index 166cb6781..4c8fc5d43 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -329,15 +329,15 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput) if (packet) { - auto fvel = loc.fvel; - auto svel = loc.svel; - auto ang = FixedToInt(pp->camq16ang); + auto const ang = FixedToInt(pp->camq16ang); - loc.fvel = mulscale9(fvel, sintable[NORM_ANGLE(ang + 512)]) + mulscale9(svel, sintable[NORM_ANGLE(ang)]); - loc.svel = mulscale9(fvel, sintable[NORM_ANGLE(ang)]) + mulscale9(svel, sintable[NORM_ANGLE(ang + 1536)]); - loc.q16ang = pp->camq16ang; - loc.q16horiz = pp->camq16horiz; *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->q16ang = pp->camq16ang; + packet->q16horiz = pp->camq16horiz; + loc = {}; } }