Post-merge cleanup and improvements for #655

This commit is contained in:
Wojtek Figat
2022-01-11 15:04:40 +01:00
parent 464ac69de6
commit 317a9d63bc
4 changed files with 123 additions and 97 deletions

View File

@@ -508,16 +508,14 @@ float Input::GetGamepadAxis(InputGamepadIndex gamepad, GamepadAxis axis)
{
if (gamepad == InputGamepadIndex::All)
{
float val = 0;
float result = 0.0f;
for (auto g : Gamepads)
{
val += g->GetAxis(axis);
if(val >= 1)
return 1;
if (val <= -1)
return -1;
float v = g->GetAxis(axis);
if (Math::Abs(v) > Math::Abs(result))
result = v;
}
return val;
return result;
}
else
{