- fix joystick scaling for all games.

* Repairs https://forum.zdoom.org/viewtopic.php?f=340&t=67239 and https://forum.zdoom.org/viewtopic.php?f=340&t=67933
* Values that come from GZDoom backend are too low to be suitable for the Build games which were dividing by 'analogExtent'.
* Remove definition of analogExtent from all games and define in inputstate.h, then define joyaxesScale as 75% of analogExtent to provide a bit of headroom and not have a scale of 1.0 be full speed.
* Invert the returned results of GetAxes() as the returned floats are reversed for build games.
* Leverage scaleAdjustmentToInverval() on game-side code to consistently scale the input irrespective of frame rate, vsync etc.
This commit is contained in:
Mitchell Richters 2020-06-12 13:47:40 +10:00 committed by Christoph Oelckers
parent a54e892743
commit d79a5d256d
6 changed files with 61 additions and 69 deletions

View file

@ -195,9 +195,9 @@ void CONTROL_GetInput(ControlInfo* info)
I_GetAxes(joyaxes);
info->dyaw += joyaxes[JOYAXIS_Yaw];
info->dx += joyaxes[JOYAXIS_Side];
info->dz += joyaxes[JOYAXIS_Forward];
info->dpitch += joyaxes[JOYAXIS_Pitch];
info->dyaw += -joyaxes[JOYAXIS_Yaw] * joyaxesScale;
info->dx += -joyaxes[JOYAXIS_Side] * joyaxesScale;
info->dz += -joyaxes[JOYAXIS_Forward] * joyaxesScale;
info->dpitch += -joyaxes[JOYAXIS_Pitch] * joyaxesScale;
}
}