diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index b42ec59b91..f9620b1b45 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -100,7 +100,7 @@ long PadHandlerBase::FindKeyCodeByString(const std::unordered_map(std::clamp(raw_value, minimum, maximum) - minimum) / (abs(maximum) + abs(minimum)); @@ -108,7 +108,7 @@ float PadHandlerBase::ScaleStickInput(s32 raw_value, int minimum, int maximum) } // Get new scaled value between -255 and 255 based on its minimum and maximum -float PadHandlerBase::ScaleStickInput2(s32 raw_value, int minimum, int maximum) +float PadHandlerBase::ScaledInput2(s32 raw_value, int minimum, int maximum) { // value based on max range converted to [0, 1] float val = static_cast(std::clamp(raw_value, minimum, maximum) - minimum) / (abs(maximum) + abs(minimum)); @@ -160,7 +160,7 @@ u16 PadHandlerBase::NormalizeStickInput(u16 raw_value, int threshold, int multip if (ignore_threshold) { - return static_cast(ScaleStickInput(scaled_value, 0, thumb_max)); + return static_cast(ScaledInput(scaled_value, 0, thumb_max)); } else { diff --git a/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h index 336dec1717..4fcfd49cca 100644 --- a/rpcs3/Emu/Io/PadHandler.h +++ b/rpcs3/Emu/Io/PadHandler.h @@ -89,10 +89,10 @@ protected: static long FindKeyCodeByString(const std::unordered_map& map, const std::string& name, bool fallback = true); // Get new scaled value between 0 and 255 based on its minimum and maximum - static float ScaleStickInput(s32 raw_value, int minimum, int maximum); + static float ScaledInput(s32 raw_value, int minimum, int maximum); // Get new scaled value between -255 and 255 based on its minimum and maximum - static float ScaleStickInput2(s32 raw_value, int minimum, int maximum); + static float ScaledInput2(s32 raw_value, int minimum, int maximum); // Get normalized trigger value based on the range defined by a threshold u16 NormalizeTriggerInput(u16 value, int threshold); diff --git a/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp index 2923073d8a..0da05f3191 100644 --- a/rpcs3/Input/evdev_joystick_handler.cpp +++ b/rpcs3/Input/evdev_joystick_handler.cpp @@ -243,12 +243,12 @@ std::unordered_map> evdev_joystick_handler::GetButtonV // Triggers do not need handling of negative values if (min >= 0 && std::find(m_positive_axis.begin(), m_positive_axis.end(), code) == m_positive_axis.end()) { - const float fvalue = ScaleStickInput(val, min, max); + const float fvalue = ScaledInput(val, min, max); button_values.emplace(code, std::make_pair(static_cast(fvalue), false)); continue; } - const float fvalue = ScaleStickInput2(val, min, max); + const float fvalue = ScaledInput2(val, min, max); if (fvalue < 0) button_values.emplace(code, std::make_pair(static_cast(std::abs(fvalue)), true)); else @@ -544,11 +544,11 @@ int evdev_joystick_handler::GetButtonInfo(const input_event& evt, const std::sha { m_is_negative = false; m_is_button_or_trigger = true; - value = static_cast(ScaleStickInput(val, min, max)); + value = static_cast(ScaledInput(val, min, max)); return code; } - const float fvalue = ScaleStickInput2(val, min, max); + const float fvalue = ScaledInput2(val, min, max); m_is_negative = fvalue < 0; value = static_cast(std::abs(fvalue)); return code; diff --git a/rpcs3/Input/mm_joystick_handler.cpp b/rpcs3/Input/mm_joystick_handler.cpp index 31cb5d9a95..20aae71159 100644 --- a/rpcs3/Input/mm_joystick_handler.cpp +++ b/rpcs3/Input/mm_joystick_handler.cpp @@ -383,7 +383,7 @@ std::unordered_map mm_joystick_handler::GetButtonValues(const JOYINFOE auto add_axis_value = [&](DWORD axis, UINT min, UINT max, u64 pos, u64 neg) { - float val = ScaleStickInput2(axis, min, max); + float val = ScaledInput2(axis, min, max); if (val < 0) { button_values.emplace(pos, 0);