add TransformPoint impl for NDS
This commit is contained in:
parent
a59e9a1ce8
commit
2b00e33560
|
@ -197,11 +197,7 @@ namespace BizHawk.Client.Common.Filters
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector2 TransformPoint(string channel, Vector2 point)
|
public override Vector2 TransformPoint(string channel, Vector2 point)
|
||||||
{
|
=> _nds.GetScreenCoords(point.X, point.Y);
|
||||||
// TODO
|
|
||||||
Console.WriteLine($"TODO ScreenControlNDS TransformPoint {point.X} / {point.Y}");
|
|
||||||
return base.TransformPoint(channel, point);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -294,5 +294,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
|
|
||||||
[BizImport(CC)]
|
[BizImport(CC)]
|
||||||
public abstract void GetTouchCoords(ref int x, ref int y);
|
public abstract void GetTouchCoords(ref int x, ref int y);
|
||||||
|
|
||||||
|
[BizImport(CC)]
|
||||||
|
public abstract void GetScreenCoords(ref float x, ref float y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
private IntPtr GetGLProcAddressCallback(string proc)
|
private IntPtr GetGLProcAddressCallback(string proc)
|
||||||
=> _openGLProvider.GetGLProcAddress(proc);
|
=> _openGLProvider.GetGLProcAddress(proc);
|
||||||
|
|
||||||
|
// TODO: Probably can make these into an interface (ITouchScreen with UntransformPoint/TransformPoint methods?)
|
||||||
|
// Which case the hackiness of the current screen controls wouldn't be as bad
|
||||||
public Vector2 GetTouchCoords(int x, int y)
|
public Vector2 GetTouchCoords(int x, int y)
|
||||||
{
|
{
|
||||||
if (_glContext != null)
|
if (_glContext != null)
|
||||||
|
@ -86,6 +88,21 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
return new(x, y);
|
return new(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector2 GetScreenCoords(float x, float y)
|
||||||
|
{
|
||||||
|
if (_glContext != null)
|
||||||
|
{
|
||||||
|
_core.GetScreenCoords(ref x, ref y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// no GL context, so nothing fancy can be applied
|
||||||
|
y = Math.Min(256, y + 192);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
[CoreConstructor(VSystemID.Raw.NDS)]
|
[CoreConstructor(VSystemID.Raw.NDS)]
|
||||||
public NDS(CoreLoadParameters<NDSSettings, NDSSyncSettings> lp)
|
public NDS(CoreLoadParameters<NDSSettings, NDSSyncSettings> lp)
|
||||||
: base(lp.Comm, new()
|
: base(lp.Comm, new()
|
||||||
|
|
Loading…
Reference in New Issue