mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 16:35:28 +00:00
[SDL] Correctly byteswap Guid
Fixes an issue where GamePad Guids would fail to be matched with the Guids in the configuration database.
This commit is contained in:
parent
71e5a4f4f3
commit
2df0496c44
|
@ -1542,6 +1542,16 @@ namespace OpenTK.Platform.SDL2
|
|||
}
|
||||
}
|
||||
|
||||
// The Guid(byte[]) constructor swaps the first 4+2+2 bytes.
|
||||
// Compensate for that, otherwise we will not be able to match
|
||||
// the Guids in the configuration database.
|
||||
if (BitConverter.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data, 0, 4);
|
||||
Array.Reverse(data, 4, 2);
|
||||
Array.Reverse(data, 6, 2);
|
||||
}
|
||||
|
||||
return new Guid(data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue