diff options
| author | JosJuice <josjuice@gmail.com> | 2023-03-04 12:24:31 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-03-08 17:49:02 +0100 |
| commit | 3eac1fc28494709dc7cbfaae81cf0b1f42f12e17 (patch) | |
| tree | 402a35fc275cc7c9c31bc5dd2270e13edb6a6b32 /Source/Core/DolphinQt/TAS/TASInputWindow.cpp | |
| parent | 95ce41ac56f2774a1b18a1a1dafd2dadee248616 (diff) | |
DolphinQt: Rework TAS input threading, part 1 (buttons)
This gets rid of a blocking operation, improving performance and fixing
https://bugs.dolphin-emu.org/issues/12893.
This also makes us no longer directly access the state of certain UI
elements from the CPU thread, which probably wasn't thread-safe but
doesn't seem to have caused any observable issues so far.
Diffstat (limited to 'Source/Core/DolphinQt/TAS/TASInputWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/TAS/TASInputWindow.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Source/Core/DolphinQt/TAS/TASInputWindow.cpp b/Source/Core/DolphinQt/TAS/TASInputWindow.cpp index 0054043a8e..61e37e5238 100644 --- a/Source/Core/DolphinQt/TAS/TASInputWindow.cpp +++ b/Source/Core/DolphinQt/TAS/TASInputWindow.cpp @@ -239,18 +239,7 @@ std::optional<ControlState> TASInputWindow::GetButton(TASCheckBox* checkbox, { const bool pressed = std::llround(controller_state) > 0; if (m_use_controller->isChecked()) - { - if (pressed) - { - m_checkbox_set_by_controller[checkbox] = true; - QueueOnObjectBlocking(checkbox, [checkbox] { checkbox->setChecked(true); }); - } - else if (m_checkbox_set_by_controller.count(checkbox) && m_checkbox_set_by_controller[checkbox]) - { - m_checkbox_set_by_controller[checkbox] = false; - QueueOnObjectBlocking(checkbox, [checkbox] { checkbox->setChecked(false); }); - } - } + checkbox->OnControllerValueChanged(pressed); return checkbox->GetValue() ? 1.0 : 0.0; } |
