TasMovie - don't create a Bk2MnemonicConstants object everytime a display value is requested, gives a modest speed up to tastudio performance
This commit is contained in:
parent
d7f9b2ccd7
commit
c033b26ad0
|
@ -12,6 +12,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public sealed partial class TasMovie : Bk2Movie, INotifyPropertyChanged
|
public sealed partial class TasMovie : Bk2Movie, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
private readonly Bk2MnemonicConstants MnemonicConstants = new Bk2MnemonicConstants();
|
||||||
private List<bool> LagLog = new List<bool>();
|
private List<bool> LagLog = new List<bool>();
|
||||||
private readonly TasStateManager StateManager;
|
private readonly TasStateManager StateManager;
|
||||||
public TasMovieMarkerList Markers { get; set; }
|
public TasMovieMarkerList Markers { get; set; }
|
||||||
|
@ -137,14 +138,12 @@ namespace BizHawk.Client.Common
|
||||||
return CreateDisplayValueForButton(adapter, buttonName);
|
return CreateDisplayValueForButton(adapter, buttonName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string CreateDisplayValueForButton(IController adapter, string buttonName)
|
public string CreateDisplayValueForButton(IController adapter, string buttonName)
|
||||||
{
|
{
|
||||||
var mnemonics = new Bk2MnemonicConstants();
|
|
||||||
|
|
||||||
if (adapter.Type.BoolButtons.Contains(buttonName))
|
if (adapter.Type.BoolButtons.Contains(buttonName))
|
||||||
{
|
{
|
||||||
return adapter.IsPressed(buttonName) ?
|
return adapter.IsPressed(buttonName) ?
|
||||||
mnemonics[buttonName].ToString() :
|
MnemonicConstants[buttonName].ToString() :
|
||||||
string.Empty;
|
string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else if (Global.Emulator.Frame == _currentTasMovie.InputLogLength) // In this situation we have a "pending" frame for the user to click
|
else if (Global.Emulator.Frame == _currentTasMovie.InputLogLength) // In this situation we have a "pending" frame for the user to click
|
||||||
{
|
{
|
||||||
text = TasMovie.CreateDisplayValueForButton(
|
text = _currentTasMovie.CreateDisplayValueForButton(
|
||||||
Global.ClickyVirtualPadController,
|
Global.ClickyVirtualPadController,
|
||||||
columnName);
|
columnName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue