Compare commits

...

4 Commits

Author SHA1 Message Date
Ben. S.
1c8d8ed24f Merge 067801cf4e into 7bdf013ba6 2025-03-05 10:47:50 +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

@@ -50,6 +50,9 @@ namespace Ryujinx.Input.SDL2
{
Guid guid = SDL_JoystickGetDeviceGUID(joystickIndex);
// Remove the first 4 char of the guid (CRC part) to make it stable
string guidString = "0000" + guid.ToString().Substring(4);
// Add a unique identifier to the start of the GUID in case of duplicates.
if (guid == Guid.Empty)
@@ -62,11 +65,11 @@ namespace Ryujinx.Input.SDL2
lock (_lock)
{
int guidIndex = 0;
id = guidIndex + "-" + guid;
id = guidIndex + "-" + guidString;
while (_gamepadsIds.Contains(id))
{
id = (++guidIndex) + "-" + guid;
id = (++guidIndex) + "-" + guidString;
}
}