Compare commits

...

5 Commits

Author SHA1 Message Date
Ben. S.
2414548ccd
Merge 96f1048748 into 0db85d0aa9 2025-03-06 14:02:07 +08:00
Ben. S.
96f1048748
Update SDL2GamepadDriver.cs
Move the section after the check for empty guid (dumb me)
2025-03-05 14:41:52 +01:00
Ben. S.
067801cf4e
Merge branch 'master' into master 2025-03-05 10:47:47 +01:00
Evan Husted
bd483507f1
Merge branch 'master' into master 2025-03-04 15:07:28 -06:00
Benoit S.
d19324f687 sdl2 guid, remove the 2 CRC bytes when creating guid 2025-03-04 21:58:47 +01:00

View File

@ -57,16 +57,19 @@ namespace Ryujinx.Input.SDL2
return null; return null;
} }
// Remove the first 4 char of the guid (CRC part) to make it stable
string guidString = "0000" + guid.ToString().Substring(4);
string id; string id;
lock (_lock) lock (_lock)
{ {
int guidIndex = 0; int guidIndex = 0;
id = guidIndex + "-" + guid; id = guidIndex + "-" + guidString;
while (_gamepadsIds.Contains(id)) while (_gamepadsIds.Contains(id))
{ {
id = (++guidIndex) + "-" + guid; id = (++guidIndex) + "-" + guidString;
} }
} }