Greatly improve performance of the virtualpad tool, most configurations will have no speed cost unless there is no movie, movie speeds are much improved.
This commit is contained in:
parent
130f0418a9
commit
9210b4d9a1
|
@ -13,6 +13,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
private readonly PadSchema _schema;
|
||||
private bool _readOnly;
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
PadControls.ForEach(c => c.UpdateValues());
|
||||
}
|
||||
|
||||
private List<IVirtualPadControl> PadControls
|
||||
{
|
||||
get
|
||||
|
|
|
@ -195,7 +195,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Pads.ForEach(pad => pad.Clear());
|
||||
}
|
||||
|
||||
Pads.ForEach(pad => pad.Refresh());
|
||||
Pads.ForEach(pad => pad.UpdateValues());
|
||||
}
|
||||
|
||||
public void FastUpdate()
|
||||
|
|
|
@ -9,6 +9,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
void Clear();
|
||||
|
||||
void UpdateValues();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the state of the control based on the given controller state
|
||||
/// </summary>
|
||||
|
|
|
@ -36,6 +36,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#region IVirtualPadControl Implementation
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
if (AnalogTrackBar.Value != (int)Global.StickyXORAdapter.GetFloat(Name))
|
||||
{
|
||||
RefreshWidgets();
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Global.StickyXORAdapter.Unset(Name);
|
||||
|
@ -168,7 +176,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
private void RefreshWidgets()
|
||||
{
|
||||
if (!_isSet)
|
||||
{
|
||||
|
@ -177,7 +185,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
ValueLabel.Text = AnalogTrackBar.Value.ToString();
|
||||
_programmaticallyChangingValue = false;
|
||||
}
|
||||
|
||||
}
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
RefreshWidgets();
|
||||
base.OnPaint(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#region IVirtualPadControl Implementation
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
// Nothing to do
|
||||
// This tool already draws as necessary
|
||||
}
|
||||
|
||||
public void Set(IController controller)
|
||||
{
|
||||
AnalogStick.Set(controller);
|
||||
|
|
|
@ -36,6 +36,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
// Nothing to do
|
||||
// This tool already draws as necessary
|
||||
}
|
||||
|
||||
public void Set(IController controller)
|
||||
{
|
||||
var newVal = controller.IsPressed(Name);
|
||||
|
|
|
@ -35,6 +35,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#region IVirtualPadControl Implementation
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
TargetPanel.Refresh();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Global.StickyXORAdapter.Unset(XName);
|
||||
|
|
Loading…
Reference in New Issue