mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Merge pull request #7143 from lioncash/bt-helper
BTEmu: Make m_WiiMotes private
This commit is contained in:
@ -1401,7 +1401,7 @@ void MainWindow::OnConnectWiiRemote(int id)
|
||||
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(id | 0x100)->IsConnected();
|
||||
const bool is_connected = bt && bt->AccessWiiMoteByIndex(id)->IsConnected();
|
||||
Wiimote::Connect(id, !is_connected);
|
||||
});
|
||||
}
|
||||
|
@ -914,14 +914,16 @@ void MenuBar::UpdateToolsMenu(bool emulation_started)
|
||||
const auto bt = ios ? std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
|
||||
ios->GetDeviceByName("/dev/usb/oh1/57e/305")) :
|
||||
nullptr;
|
||||
bool enable_wiimotes =
|
||||
const bool enable_wiimotes =
|
||||
emulation_started && bt && !SConfig::GetInstance().m_bt_passthrough_enabled;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (std::size_t i = 0; i < m_wii_remotes.size(); i++)
|
||||
{
|
||||
m_wii_remotes[i]->setEnabled(enable_wiimotes);
|
||||
QAction* const wii_remote = m_wii_remotes[i];
|
||||
|
||||
wii_remote->setEnabled(enable_wiimotes);
|
||||
if (enable_wiimotes)
|
||||
m_wii_remotes[i]->setChecked(bt->AccessWiiMote(0x0100 + i)->IsConnected());
|
||||
wii_remote->setChecked(bt->AccessWiiMoteByIndex(i)->IsConnected());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user