Merge pull request #6234 from amolloy/high_sierra
Fix Wiimote support on macOS 10.13 High Sierra
This commit is contained in:
commit
3b887388cd
|
@ -13,10 +13,12 @@ class WiimoteScannerDarwin final : public WiimoteScannerBackend
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WiimoteScannerDarwin() = default;
|
WiimoteScannerDarwin() = default;
|
||||||
~WiimoteScannerDarwin() override = default;
|
~WiimoteScannerDarwin() override;
|
||||||
bool IsReady() const override;
|
bool IsReady() const override;
|
||||||
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
|
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
|
||||||
void Update() override {} // not needed
|
void Update() override {} // not needed
|
||||||
|
private:
|
||||||
|
bool stopScanning = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
|
|
||||||
namespace WiimoteReal
|
namespace WiimoteReal
|
||||||
{
|
{
|
||||||
|
WiimoteScannerDarwin::~WiimoteScannerDarwin()
|
||||||
|
{
|
||||||
|
stopScanning = true;
|
||||||
|
}
|
||||||
|
|
||||||
void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
||||||
Wiimote*& found_board)
|
Wiimote*& found_board)
|
||||||
{
|
{
|
||||||
|
@ -54,8 +59,8 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
CFRunLoopRun();
|
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
|
||||||
} while (!sbt->done);
|
} while (!sbt->done && !stopScanning);
|
||||||
|
|
||||||
int found_devices = [[bti foundDevices] count];
|
int found_devices = [[bti foundDevices] count];
|
||||||
|
|
||||||
|
@ -255,7 +260,6 @@ void WiimoteDarwin::DisablePowerAssertionInternal()
|
||||||
aborted:(BOOL)aborted
|
aborted:(BOOL)aborted
|
||||||
{
|
{
|
||||||
done = true;
|
done = true;
|
||||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender device:(IOBluetoothDevice*)device
|
- (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender device:(IOBluetoothDevice*)device
|
||||||
|
|
Loading…
Reference in New Issue