Use method overloads that support trimming. Mark some types to be trimming friendly (#4083)
* Use method overloads that support trimming. Mark some types to be trimming friendly * Use generic version of marshalling method
This commit is contained in:
parent
ba5c0cf5d8
commit
edf7e628ca
10 changed files with 26 additions and 22 deletions
|
@ -7,8 +7,7 @@ namespace Ryujinx.Ava.Input
|
|||
{
|
||||
internal static class AvaloniaKeyboardMappingHelper
|
||||
{
|
||||
private static readonly AvaKey[] _keyMapping = new AvaKey[(int)Key.Count]
|
||||
{
|
||||
private static readonly AvaKey[] _keyMapping = {
|
||||
// NOTE: Invalid
|
||||
AvaKey.None,
|
||||
|
||||
|
@ -151,16 +150,16 @@ namespace Ryujinx.Ava.Input
|
|||
|
||||
static AvaloniaKeyboardMappingHelper()
|
||||
{
|
||||
var inputKeys = Enum.GetValues(typeof(Key));
|
||||
var inputKeys = Enum.GetValues<Key>();
|
||||
|
||||
// NOTE: Avalonia.Input.Key is not contiguous and quite large, so use a dictionary instead of an array.
|
||||
_avaKeyMapping = new Dictionary<AvaKey, Key>();
|
||||
|
||||
foreach (var key in inputKeys)
|
||||
{
|
||||
if (TryGetAvaKey((Key)key, out var index))
|
||||
if (TryGetAvaKey(key, out var index))
|
||||
{
|
||||
_avaKeyMapping[index] = (Key)key;
|
||||
_avaKeyMapping[index] = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue