diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2020-07-22 17:20:20 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2020-08-16 11:38:13 -0500 |
| commit | 13ee6bd7bb50d0f23d32383f396e4199533868cd (patch) | |
| tree | ae023b9027588611e8e29d31137efce0d96c5b56 /Source/Core/DolphinQt/MainWindow.cpp | |
| parent | 89ca9b51ad511bb7b4293e405e0842306c5403c4 (diff) | |
BTEmu/Wiimote: Cleanups/Fixes.
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/MainWindow.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index ddc09bb825..b1fac6ecf4 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -1705,10 +1705,12 @@ void MainWindow::OnConnectWiiRemote(int id) if (!ios || SConfig::GetInstance().m_bt_passthrough_enabled) return; Core::RunAsCPUThread([&] { - const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>( - ios->GetDeviceByName("/dev/usb/oh1/57e/305")); - const bool is_connected = bt && bt->AccessWiimoteByIndex(id)->IsConnected(); - Wiimote::Connect(id, !is_connected); + if (const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>( + ios->GetDeviceByName("/dev/usb/oh1/57e/305"))) + { + const auto wm = bt->AccessWiimoteByIndex(id); + wm->Activate(!wm->IsConnected()); + } }); } |
