- partially revert 19e4393a4f by adding the player's mouse input after calculating the true pitch of p->q16horiz.

* Need to add `p->horizAdjust` in with `p->q16horiz` because the values passed to that variable are the same as what would have been directly added to `p->q16horiz` in `processinput()`.
* Leaving mouse input to apply after calculating the pitch lets us take advantage of the calculated pitch's accuracy to provide consistent mouse input across the pitch's range.
This commit is contained in:
Mitchell Richters 2020-08-03 22:39:09 +10:00
parent 1556e80dd2
commit d3d9bb0823

View file

@ -961,7 +961,7 @@ void sethorizon(int snum, int sb_snum, double factor, bool frominput, fixed_t ad
auto p = &ps[snum];
// Calculate adjustment as true pitch (Fixed point math really sucks...)
double horizAngle = atan2((p->q16horiz + ((factor * p->horizAdjust) * 65536) + adjustment) - F16(100), F16(128)) * (512. / pi::pi());
double horizAngle = atan2((p->q16horiz + ((factor * p->horizAdjust) * 65536)) - F16(100), F16(128)) * (512. / pi::pi()) + (adjustment / 65536.);
if (p->return_to_center > 0 && (sb_snum & (SKB_LOOK_UP | SKB_LOOK_DOWN)) == 0) // only snap back if no relevant button is pressed.
{