WiimoteReal: Add function to test specifically for a wii remote name.
This commit is contained in:
1 parent
8323c21e40
commit
94ecf4df39
2 files changed
+13
-6
No files matched your search
@@ -965,13 +965,17 @@ void Refresh()
|
|||||||
s_wiimote_scanner.SetScanMode(WiimoteScanMode::SCAN_ONCE);
|
s_wiimote_scanner.SetScanMode(WiimoteScanMode::SCAN_ONCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsValidDeviceName(const std::string& name)
|
bool IsValidDeviceName(std::string_view name)
|
||||||
{
|
{
|
||||||
return "Nintendo RVL-CNT-01" == name || "Nintendo RVL-CNT-01-TR" == name ||
|
return IsWiimoteName(name) || IsBalanceBoardName(name);
|
||||||
IsBalanceBoardName(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsBalanceBoardName(const std::string& name)
|
bool IsWiimoteName(std::string_view name)
|
||||||
|
{
|
||||||
|
return name == "Nintendo RVL-CNT-01" || name == "Nintendo RVL-CNT-01-TR";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsBalanceBoardName(std::string_view name)
|
||||||
{
|
{
|
||||||
return "Nintendo RVL-WBC-01" == name;
|
return "Nintendo RVL-WBC-01" == name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -225,8 +226,10 @@ extern std::unique_ptr<Wiimote> g_wiimotes[MAX_BBMOTES];
|
|||||||
|
|
||||||
void AddWiimoteToPool(std::unique_ptr<Wiimote>);
|
void AddWiimoteToPool(std::unique_ptr<Wiimote>);
|
||||||
|
|
||||||
bool IsValidDeviceName(const std::string& name);
|
bool IsValidDeviceName(std::string_view name);
|
||||||
bool IsBalanceBoardName(const std::string& name);
|
bool IsWiimoteName(std::string_view name);
|
||||||
|
bool IsBalanceBoardName(std::string_view name);
|
||||||
|
|
||||||
bool IsNewWiimote(const std::string& identifier);
|
bool IsNewWiimote(const std::string& identifier);
|
||||||
|
|
||||||
bool IsKnownDeviceId(const USBUtils::DeviceInfo&);
|
bool IsKnownDeviceId(const USBUtils::DeviceInfo&);
|
||||||
|
|||||||
Reference in new issue
Block a user