implement bitwise logic for axes
noticable in inputdisplay or when trying to set axis autofire
This commit is contained in:
parent
509bd1504a
commit
6d9aa4d467
|
@ -41,11 +41,7 @@ namespace BizHawk.Client.Common
|
|||
_buttonStarts.Clear();
|
||||
}
|
||||
|
||||
/// <exception cref="NotImplementedException">always</exception>
|
||||
public int AxisValue(string name)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public int AxisValue(string name) => Definition.Axes[name].Neutral;
|
||||
|
||||
public IReadOnlyCollection<(string Name, int Strength)> GetHapticsSnapshot() => Array.Empty<(string, int)>();
|
||||
|
||||
|
|
|
@ -18,9 +18,11 @@ namespace BizHawk.Client.Common
|
|||
return false;
|
||||
}
|
||||
|
||||
// pass axes solely from the original source
|
||||
// this works in the code because SourceOr is the autofire controller
|
||||
public int AxisValue(string name) => Source.AxisValue(name);
|
||||
public int AxisValue(string name)
|
||||
{
|
||||
int neutralValue = Source.Definition.Axes[name].Neutral;
|
||||
return SourceAnd.AxisValue(name) != neutralValue ? Source.AxisValue(name) : neutralValue;
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<(string Name, int Strength)> GetHapticsSnapshot() => Source.GetHapticsSnapshot();
|
||||
|
||||
|
@ -77,9 +79,11 @@ namespace BizHawk.Client.Common
|
|||
| (SourceOr?.IsPressed(button) ?? false);
|
||||
}
|
||||
|
||||
// pass axes solely from the original source
|
||||
// this works in the code because SourceOr is the autofire controller
|
||||
public int AxisValue(string name) => Source.AxisValue(name);
|
||||
public int AxisValue(string name)
|
||||
{
|
||||
int sourceValue = Source.AxisValue(name);
|
||||
return sourceValue != Source.Definition.Axes[name].Neutral ? sourceValue : SourceOr.AxisValue(name);
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<(string Name, int Strength)> GetHapticsSnapshot() => Source.GetHapticsSnapshot();
|
||||
|
||||
|
|
Loading…
Reference in New Issue