From 3eac1fc28494709dc7cbfaae81cf0b1f42f12e17 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 4 Mar 2023 12:24:31 +0100 Subject: 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. --- Source/Core/DolphinQt/TAS/TASInputWindow.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'Source/Core/DolphinQt/TAS/TASInputWindow.cpp') 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 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; } -- cgit v1.2.3