mirror of https://github.com/PCSX2/pcsx2.git
PAD: Fix trigger deadzone/scale setting
This commit is contained in:
parent
13ed41d077
commit
a1bc39141e
|
@ -150,7 +150,7 @@ void KeyStatus::Set(u32 pad, u32 index, float value)
|
|||
else if (IsTriggerKey(index))
|
||||
{
|
||||
const float s_value = std::clamp(value * m_trigger_scale[pad][1], 0.0f, 1.0f);
|
||||
const float dz_value = (m_axis_scale[pad][0] > 0.0f && s_value < m_axis_scale[pad][0]) ? 0.0f : s_value;
|
||||
const float dz_value = (m_trigger_scale[pad][0] > 0.0f && s_value < m_trigger_scale[pad][0]) ? 0.0f : s_value;
|
||||
m_button_pressure[pad][index] = static_cast<u8>(dz_value * 255.0f);
|
||||
if (dz_value > 0.0f)
|
||||
m_button[pad] &= ~(1u << bitmask_mapping[index]);
|
||||
|
|
|
@ -218,7 +218,7 @@ void PAD::LoadConfig(const SettingsInterface& si)
|
|||
const float axis_deadzone = si.GetFloatValue(section.c_str(), "Deadzone", DEFAULT_STICK_DEADZONE);
|
||||
const float axis_scale = si.GetFloatValue(section.c_str(), "AxisScale", DEFAULT_STICK_SCALE);
|
||||
const float trigger_deadzone = si.GetFloatValue(section.c_str(), "TriggerDeadzone", DEFAULT_TRIGGER_DEADZONE);
|
||||
const float trigger_scale = si.GetFloatValue(section.c_str(), "TriggerDeadzone", DEFAULT_TRIGGER_SCALE);
|
||||
const float trigger_scale = si.GetFloatValue(section.c_str(), "TriggerScale", DEFAULT_TRIGGER_SCALE);
|
||||
const float button_deadzone = si.GetFloatValue(section.c_str(), "ButtonDeadzone", DEFAULT_BUTTON_DEADZONE);
|
||||
g_key_status.SetAxisScale(i, axis_deadzone, axis_scale);
|
||||
g_key_status.SetTriggerScale(i, trigger_deadzone, trigger_scale);
|
||||
|
|
Loading…
Reference in New Issue