summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-07-27 15:02:28 +0800
committerGitHub <noreply@github.com>2017-07-27 15:02:28 +0800
commit7a51b0bcec891b95b3ea98b03e239ec7937ceb13 (patch)
treee9029ad02ce917203b9b637891b23f6a5e246075 /Source/Core/DolphinWX/FrameTools.cpp
parent5c29ea54c5413384c4e24bff41d7386f22e7be7e (diff)
parent1c33dfc787419d156a5d097fba878f6d09f3c75f (diff)
Merge pull request #5807 from leoetlino/connect-wiimote
Move the Wiimote connect code out of Host
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index d633561cfd..e448d2329c 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -1406,27 +1406,6 @@ void CFrame::OnFifoPlayer(wxCommandEvent& WXUNUSED(event))
}
}
-void CFrame::ConnectWiimote(int wm_idx, bool connect)
-{
- if (Core::IsRunning() && SConfig::GetInstance().bWii &&
- !SConfig::GetInstance().m_bt_passthrough_enabled)
- {
- Core::RunAsCPUThread([&] {
- const auto ios = IOS::HLE::GetIOS();
- if (!ios)
- return;
-
- const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
- ios->GetDeviceByName("/dev/usb/oh1/57e/305"));
- if (bt)
- bt->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
- const char* message = connect ? "Wii Remote %i connected" : "Wii Remote %i disconnected";
- Core::DisplayMessage(StringFromFormat(message, wm_idx + 1), 3000);
- Host_UpdateMainFrame();
- });
- }
-}
-
void CFrame::OnConnectWiimote(wxCommandEvent& event)
{
const auto ios = IOS::HLE::GetIOS();
@@ -1435,9 +1414,9 @@ void CFrame::OnConnectWiimote(wxCommandEvent& event)
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->AccessWiiMote((event.GetId() - IDM_CONNECT_WIIMOTE1) | 0x100)->IsConnected();
- ConnectWiimote(event.GetId() - IDM_CONNECT_WIIMOTE1, !is_connected);
+ const unsigned int wiimote_index = event.GetId() - IDM_CONNECT_WIIMOTE1;
+ const bool is_connected = bt && bt->AccessWiiMote(wiimote_index | 0x100)->IsConnected();
+ Wiimote::Connect(wiimote_index, !is_connected);
});
}