mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
input: move pressure sensitivity to the handlers
This removes a data race where the button was kept pressed but the values ingame could vary
This commit is contained in:
parent
977d729ee0
commit
b07960d3bc
3 changed files with 28 additions and 10 deletions
|
@ -244,11 +244,8 @@ void pad_thread::ThreadFunc()
|
|||
{
|
||||
const auto& pad = m_pads[i];
|
||||
|
||||
// I guess this is the best place to add pressure sensitivity without too much code duplication.
|
||||
if (pad->m_port_status & CELL_PAD_STATUS_CONNECTED)
|
||||
{
|
||||
const bool adjust_pressure = pad->m_pressure_intensity_button_index >= 0 && pad->m_buttons[pad->m_pressure_intensity_button_index].m_pressed;
|
||||
|
||||
for (auto& button : pad->m_buttons)
|
||||
{
|
||||
if (button.m_pressed)
|
||||
|
@ -262,11 +259,6 @@ void pad_thread::ThreadFunc()
|
|||
{
|
||||
any_button_pressed = true;
|
||||
}
|
||||
|
||||
if (adjust_pressure)
|
||||
{
|
||||
button.m_value = pad->m_pressure_intensity;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue