Skip to content
Permalink
Browse files
Merge pull request #6234 from amolloy/high_sierra
Fix Wiimote support on macOS 10.13 High Sierra
  • Loading branch information
Helios747 committed Dec 7, 2017
2 parents 8a83007 + f5839f8 commit 3b88738
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
@@ -13,10 +13,12 @@ class WiimoteScannerDarwin final : public WiimoteScannerBackend
{
public:
WiimoteScannerDarwin() = default;
~WiimoteScannerDarwin() override = default;
~WiimoteScannerDarwin() override;
bool IsReady() const override;
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
void Update() override {} // not needed
private:
bool stopScanning = false;
};
}

@@ -21,6 +21,11 @@ @interface ConnectBT : NSObject

namespace WiimoteReal
{
WiimoteScannerDarwin::~WiimoteScannerDarwin()
{
stopScanning = true;
}

void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
Wiimote*& found_board)
{
@@ -54,8 +59,8 @@ @interface ConnectBT : NSObject

do
{
CFRunLoopRun();
} while (!sbt->done);
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
} while (!sbt->done && !stopScanning);

int found_devices = [[bti foundDevices] count];

@@ -255,7 +260,6 @@ - (void)deviceInquiryComplete:(IOBluetoothDeviceInquiry*)sender
aborted:(BOOL)aborted
{
done = true;
CFRunLoopStop(CFRunLoopGetCurrent());
}

- (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender device:(IOBluetoothDevice*)device

0 comments on commit 3b88738

Please sign in to comment.