[SI] add a way to check if the current controller is a gcpad

(or gcpad-compatible)
This commit is contained in:
mathieui 2016-02-02 22:04:27 +01:00
parent 2282651fdb
commit d61ef9a95a
2 changed files with 22 additions and 0 deletions

View File

@ -67,6 +67,26 @@ public:
}; };
// Check if a device class is inheriting from CSIDevice_GCController
// The goal of this function is to avoid special casing a long list of
// device types when there is no "real" input device, e.g. when playing
// a TAS movie, or netplay input.
bool SIDevice_IsGCController(SIDevices type)
{
switch (type)
{
case SIDEVICE_GC_CONTROLLER:
case SIDEVICE_WIIU_ADAPTER:
case SIDEVICE_GC_TARUKONGA:
case SIDEVICE_DANCEMAT:
case SIDEVICE_GC_STEERING:
return true;
default:
return false;
}
}
// F A C T O R Y // F A C T O R Y
std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number) std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number)
{ {

View File

@ -107,4 +107,6 @@ public:
} }
}; };
bool SIDevice_IsGCController(SIDevices type);
std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number); std::unique_ptr<ISIDevice> SIDevice_Create(const SIDevices device, const int port_number);