Project64-input: Ignore empty button on device name

This commit is contained in:
zilmar 2020-07-28 12:42:59 +09:30
parent f218c2bfc9
commit 9d3bbe4659
1 changed files with 5 additions and 0 deletions

View File

@ -310,6 +310,7 @@ std::wstring CDirectInput::ControllerDevices(const N64CONTROLLER & Controller)
};
typedef std::set<GUID, GUIDComparer> GUID_LIST;
GUID_LIST DeviceGuids;
GUID EmptyGuid = { 0 };
for (size_t i = 0, n = sizeof(Buttons) / sizeof(Buttons[0]); i < n; i++)
{
@ -318,6 +319,10 @@ std::wstring CDirectInput::ControllerDevices(const N64CONTROLLER & Controller)
{
continue;
}
if (memcmp(&Buttons[i]->DeviceGuid, &EmptyGuid, sizeof(EmptyGuid)) == 0)
{
continue;
}
DeviceGuids.insert(Buttons[i]->DeviceGuid);
}