mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-28 05:37:36 -05:00
WiimoteReal: Remove unused IsReady and IsScannerReady functions
The only call of `IsScannerReady` was removed by
81be0001a9, and most of the `IsReady`
functions were only called by `IsScannerReady`.
The one exception was in `WiimoteScannerLinux`, which is now a private
function instead of inheriting from the one in `WiimoteScannerBackend`.
This commit is contained in:
@@ -48,7 +48,6 @@ class WiimoteScannerAndroid final : public WiimoteScannerBackend
|
||||
public:
|
||||
WiimoteScannerAndroid() = default;
|
||||
~WiimoteScannerAndroid() override = default;
|
||||
bool IsReady() const override { return true; }
|
||||
|
||||
FindResults FindAttachedWiimotes() override;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ class WiimoteScannerDummy final : public WiimoteScannerBackend
|
||||
public:
|
||||
WiimoteScannerDummy() = default;
|
||||
~WiimoteScannerDummy() override = default;
|
||||
bool IsReady() const override { return false; }
|
||||
void Update() override {}
|
||||
void RequestStopSearching() override {}
|
||||
};
|
||||
|
||||
@@ -41,8 +41,6 @@ public:
|
||||
WiimoteScannerLinux();
|
||||
~WiimoteScannerLinux() override;
|
||||
|
||||
bool IsReady() const override;
|
||||
|
||||
// FYI: This backend only supports connecting remotes just found via Bluetooth inquiry.
|
||||
FindResults FindNewWiimotes() override;
|
||||
|
||||
@@ -52,6 +50,7 @@ public:
|
||||
private:
|
||||
bool Open();
|
||||
void Close();
|
||||
bool IsReady() const;
|
||||
|
||||
int m_device_id{-1};
|
||||
int m_device_sock{-1};
|
||||
|
||||
@@ -754,14 +754,4 @@ auto WiimoteScannerWindows::FindAttachedWiimotes() -> FindResults
|
||||
return FindWiimoteHIDDevices();
|
||||
}
|
||||
|
||||
bool WiimoteScannerWindows::IsReady() const
|
||||
{
|
||||
bool found_radio = false;
|
||||
EnumerateRadios([&](auto) {
|
||||
found_radio = true;
|
||||
return EnumerationControl::Stop;
|
||||
});
|
||||
return found_radio;
|
||||
}
|
||||
|
||||
} // namespace WiimoteReal
|
||||
|
||||
@@ -62,7 +62,6 @@ public:
|
||||
};
|
||||
|
||||
WiimoteScannerWindows();
|
||||
bool IsReady() const override;
|
||||
|
||||
FindResults FindNewWiimotes() override;
|
||||
FindResults FindAttachedWiimotes() override;
|
||||
|
||||
@@ -103,11 +103,6 @@ WiimoteScannerHidapi::~WiimoteScannerHidapi()
|
||||
ERROR_LOG_FMT(WIIMOTE, "Failed to clean up hidapi.");
|
||||
}
|
||||
|
||||
bool WiimoteScannerHidapi::IsReady() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
auto WiimoteScannerHidapi::FindAttachedWiimotes() -> FindResults
|
||||
{
|
||||
FindResults results;
|
||||
|
||||
@@ -35,7 +35,6 @@ class WiimoteScannerHidapi final : public WiimoteScannerBackend
|
||||
public:
|
||||
WiimoteScannerHidapi();
|
||||
~WiimoteScannerHidapi() override;
|
||||
bool IsReady() const override;
|
||||
|
||||
FindResults FindAttachedWiimotes() override;
|
||||
|
||||
|
||||
@@ -127,11 +127,6 @@ void ProcessWiimotePool()
|
||||
}
|
||||
}
|
||||
|
||||
bool IsScannerReady()
|
||||
{
|
||||
return s_wiimote_scanner.IsReady();
|
||||
}
|
||||
|
||||
void AddWiimoteToPool(std::unique_ptr<Wiimote> wiimote)
|
||||
{
|
||||
// Our real wiimote class requires an index.
|
||||
@@ -592,12 +587,6 @@ void WiimoteScanner::SetScanMode(WiimoteScanMode scan_mode)
|
||||
m_scan_mode_changed_or_population_event.Set();
|
||||
}
|
||||
|
||||
bool WiimoteScanner::IsReady() const
|
||||
{
|
||||
std::lock_guard lg(m_backends_mutex);
|
||||
return std::ranges::any_of(m_backends, &WiimoteScannerBackend::IsReady);
|
||||
}
|
||||
|
||||
static void CheckForDisconnectedWiimotes()
|
||||
{
|
||||
std::lock_guard lk(g_wiimotes_mutex);
|
||||
|
||||
@@ -181,9 +181,6 @@ class WiimoteScannerBackend
|
||||
public:
|
||||
virtual ~WiimoteScannerBackend() = default;
|
||||
|
||||
// Note: Invoked from UI thread.
|
||||
virtual bool IsReady() const = 0;
|
||||
|
||||
// function called when not looking for more Wiimotes
|
||||
virtual void Update() = 0;
|
||||
// requests the backend to stop scanning if FindWiimotes is blocking
|
||||
@@ -220,8 +217,6 @@ public:
|
||||
void SetScanMode(WiimoteScanMode scan_mode);
|
||||
void PopulateDevices();
|
||||
|
||||
bool IsReady() const;
|
||||
|
||||
private:
|
||||
void ThreadFunc();
|
||||
void PoolThreadFunc();
|
||||
@@ -259,5 +254,4 @@ void InitAdapterClass();
|
||||
void HandleWiimotesInControllerInterfaceSettingChange();
|
||||
void PopulateDevices();
|
||||
void ProcessWiimotePool();
|
||||
bool IsScannerReady();
|
||||
} // namespace WiimoteReal
|
||||
|
||||
Reference in New Issue
Block a user