mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-08-04 04:21:12 +00:00
Fix for github issue 13, terrible crash on Keyboard GetState
This commit is contained in:
parent
cd66bfaf37
commit
f38e717601
|
@ -43,7 +43,9 @@ namespace OpenTK.Input
|
||||||
const int NumInts = ((int)Key.LastKey + IntSize - 1) / IntSize;
|
const int NumInts = ((int)Key.LastKey + IntSize - 1) / IntSize;
|
||||||
// The following line triggers bogus CS0214 in gmcs 2.0.1, sigh...
|
// The following line triggers bogus CS0214 in gmcs 2.0.1, sigh...
|
||||||
unsafe fixed int Keys[NumInts];
|
unsafe fixed int Keys[NumInts];
|
||||||
unsafe fixed int Codes[256];
|
|
||||||
|
const int CodesSize = 256;
|
||||||
|
unsafe fixed int Codes[CodesSize];
|
||||||
bool is_connected;
|
bool is_connected;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -282,7 +284,7 @@ namespace OpenTK.Input
|
||||||
int* c2 = other.Codes;
|
int* c2 = other.Codes;
|
||||||
fixed (int* c1 = Codes)
|
fixed (int* c1 = Codes)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < short.MaxValue; i++)
|
for (int i = 0; i < CodesSize; i++)
|
||||||
*(c1 + i) |= *(c2 + i);
|
*(c1 + i) |= *(c2 + i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue