some TasMovie cleanups

This commit is contained in:
adelikat 2019-11-23 21:33:48 -06:00
parent 5ca08b6c29
commit 707419bba1
4 changed files with 9 additions and 15 deletions

View File

@ -127,22 +127,22 @@ namespace BizHawk.Client.Common
{
if (frame < FrameCount && frame >= 0)
{
int getframe;
int getFrame;
if (LoopOffset.HasValue)
{
if (frame < Log.Count)
{
getframe = frame;
getFrame = frame;
}
else
{
getframe = ((frame - LoopOffset.Value) % (Log.Count - LoopOffset.Value)) + LoopOffset.Value;
getFrame = ((frame - LoopOffset.Value) % (Log.Count - LoopOffset.Value)) + LoopOffset.Value;
}
}
else
{
getframe = frame;
getFrame = frame;
}
var adapter = new Bk2ControllerAdapter
@ -150,7 +150,7 @@ namespace BizHawk.Client.Common
Definition = Global.MovieSession.MovieControllerAdapter.Definition
};
adapter.SetControllersAsMnemonic(Log[getframe]);
adapter.SetControllersAsMnemonic(Log[getFrame]);
return adapter;
}

View File

@ -126,8 +126,7 @@ namespace BizHawk.Client.Common
}
}
// TODO: consider making this IEnumerable<int> instead of forcing the collection to be an array
public void RemoveFrames(int[] frames)
public void RemoveFrames(ICollection<int> frames)
{
if (frames.Any())
{

View File

@ -151,9 +151,8 @@ namespace BizHawk.Client.Common
bl.GetLump(BinaryStateLump.Input, true, delegate(TextReader tr) // Note: ExtractInputLog will clear Lag and State data potentially, this must come before loading those
{
var errorMessage = "";
IsCountingRerecords = false;
ExtractInputLog(tr, out errorMessage);
ExtractInputLog(tr, out _);
IsCountingRerecords = true;
});

View File

@ -184,7 +184,7 @@ namespace BizHawk.Client.Common
_inputStateCache.Clear();
}
public string CreateDisplayValueForButton(IController adapter, string buttonName)
private string CreateDisplayValueForButton(IController adapter, string buttonName)
{
if (adapter.Definition.BoolButtons.Contains(buttonName))
{
@ -555,11 +555,7 @@ namespace BizHawk.Client.Common
private bool _changes;
public override bool Changes
{
get
{
return _changes;
}
get => _changes;
protected set
{
if (_changes != value)