Make use of fix16 for controller aiming

git-svn-id: https://svn.eduke32.com/eduke32@7980 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-08-14 03:03:34 +00:00 committed by Christoph Oelckers
parent 314eaa7200
commit cfdb57ac6d

View file

@ -2962,7 +2962,7 @@ void P_GetInput(int const playerNum)
else else
{ {
input.q16avel = fix16_div(fix16_from_int(info.mousex), F16(32)); input.q16avel = fix16_div(fix16_from_int(info.mousex), F16(32));
input.q16avel += fix16_from_int(info.dyaw * (turnAmount << 1) / analogExtent); input.q16avel += fix16_from_int(info.dyaw) / analogExtent * (turnAmount << 1);
} }
if (g_myAimMode) if (g_myAimMode)
@ -2972,7 +2972,7 @@ void P_GetInput(int const playerNum)
if (ud.mouseflip) input.q16horz = -input.q16horz; if (ud.mouseflip) input.q16horz = -input.q16horz;
input.q16horz -= fix16_from_int(info.dpitch * turnAmount / analogExtent); input.q16horz -= fix16_from_int(info.dpitch) / analogExtent * turnAmount;
input.svel -= info.dx * keyMove / analogExtent; input.svel -= info.dx * keyMove / analogExtent;
input.fvel -= info.dz * keyMove / analogExtent; input.fvel -= info.dz * keyMove / analogExtent;