mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-04 00:26:09 +00:00
ControllerInterface: make real Wiimote use PlatformPopulateDevices()
This commit is contained in:
parent
c238e49119
commit
1d816f8f26
4 changed files with 38 additions and 13 deletions
|
@ -185,7 +185,7 @@ void ControllerInterface::RefreshDevices(RefreshReason reason)
|
|||
ciface::DualShockUDPClient::PopulateDevices();
|
||||
#endif
|
||||
|
||||
WiimoteReal::ProcessWiimotePool();
|
||||
WiimoteReal::PopulateDevices();
|
||||
|
||||
m_devices_mutex.unlock();
|
||||
|
||||
|
|
|
@ -128,13 +128,17 @@ void ReleaseDevices(std::optional<u32> count)
|
|||
|
||||
// Remove up to "count" remotes (or all of them if nullopt).
|
||||
// Real wiimotes will be added to the pool.
|
||||
g_controller_interface.RemoveDevice([&](const Core::Device* device) {
|
||||
if (device->GetSource() != SOURCE_NAME || count == removed_devices)
|
||||
return false;
|
||||
// Make sure to force the device removal immediately (as they are shared ptrs and
|
||||
// they could be kept alive, preventing us from re-creating the device)
|
||||
g_controller_interface.RemoveDevice(
|
||||
[&](const Core::Device* device) {
|
||||
if (device->GetSource() != SOURCE_NAME || count == removed_devices)
|
||||
return false;
|
||||
|
||||
++removed_devices;
|
||||
return true;
|
||||
});
|
||||
++removed_devices;
|
||||
return true;
|
||||
},
|
||||
true);
|
||||
}
|
||||
|
||||
Device::Device(std::unique_ptr<WiimoteReal::Wiimote> wiimote) : m_wiimote(std::move(wiimote))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue