Refactor HID, fix issues (#48)

* Refactor HID, fix issues

* Fix on touch screen code with wrong offset

* Don't use magic values

* Replace more magic values with actual variables, fix touch screen coordinates on different window sizes
This commit is contained in:
gdkchan 2018-03-02 22:49:17 -03:00 committed by GitHub
parent efef605b26
commit c14c69a10c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 491 additions and 709 deletions

View file

@ -1,4 +1,5 @@
using ChocolArm64.Memory;
using Ryujinx.Core.Input;
using Ryujinx.Core.OsHle;
using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Gpu;
@ -14,7 +15,7 @@ namespace Ryujinx.Core
internal NsGpu Gpu { get; private set; }
internal Horizon Os { get; private set; }
internal VirtualFs VFs { get; private set; }
internal Hid Hid { get; private set; }
public Hid Hid { get; private set; }
public event EventHandler Finish;
@ -43,20 +44,6 @@ namespace Ryujinx.Core
Os.LoadProgram(FileName);
}
public void SendControllerButtons(HidControllerID ControllerId,
HidControllerLayouts Layout,
HidControllerKeys Buttons,
JoystickPosition LeftJoystick,
JoystickPosition RightJoystick)
{
Hid.SendControllerButtons(ControllerId, Layout, Buttons, LeftJoystick, RightJoystick);
}
public void SendTouchScreenEntry(HidTouchScreenEntryTouch TouchPoint)
{
Hid.SendTouchPoint(TouchPoint);
}
internal virtual void OnFinish(EventArgs e)
{
Finish?.Invoke(this, e);