mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-04-17 16:31:55 +00:00
Minor fixes for code clarity.
This commit is contained in:
parent
1a06366db8
commit
fa0abf0d51
|
@ -73,7 +73,7 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
public MouseState GetState(int index)
|
||||
{
|
||||
if (index < mice.Count)
|
||||
if (mice.Count > index)
|
||||
return mice[index];
|
||||
else
|
||||
return new MouseState();
|
||||
|
@ -192,10 +192,12 @@ namespace OpenTK.Platform.Windows
|
|||
ContextHandle handle = new ContextHandle(rin.Header.Device);
|
||||
|
||||
MouseState mouse;
|
||||
if (rawids.ContainsKey(handle))
|
||||
mouse = mice[rawids[handle]];
|
||||
else
|
||||
return false;
|
||||
if (!rawids.ContainsKey(handle))
|
||||
{
|
||||
mice.Add(new MouseState());
|
||||
rawids.Add(handle, mice.Count - 1);
|
||||
}
|
||||
mouse = mice[rawids[handle]];
|
||||
|
||||
if ((raw.ButtonFlags & RawInputMouseState.LEFT_BUTTON_DOWN) != 0) mouse.EnableBit((int)MouseButton.Left);
|
||||
if ((raw.ButtonFlags & RawInputMouseState.LEFT_BUTTON_UP) != 0) mouse.DisableBit((int)MouseButton.Left);
|
||||
|
|
Loading…
Reference in a new issue