Rip out the Infinite movie feature, it was a gimmick that has run its course. It isn't much code but it does complicate the API for a feature that would never lead to a published tas movie

This commit is contained in:
adelikat 2020-05-23 10:55:02 -05:00
parent 3174a676f5
commit f2f2de8bdd
7 changed files with 10 additions and 89 deletions

View File

@ -98,7 +98,7 @@ namespace BizHawk.Client.Common
public bool IsLoaded() => Global.MovieSession.Movie.IsActive();
public double Length() => Global.MovieSession.Movie.FrameCount;
public int Length() => Global.MovieSession.Movie.FrameCount;
public string Mode() => Global.MovieSession.Movie.Mode.ToString().ToUpper();

View File

@ -13,7 +13,7 @@ namespace BizHawk.Client.Common
ulong GetRerecordCount();
bool GetRerecordCounting();
bool IsLoaded();
double Length();
int Length();
string Mode();
void Save(string filename = "");
void SetReadOnly(bool readOnly);

View File

@ -18,7 +18,6 @@ namespace BizHawk.Client.Common
public const string Pal = "PAL";
public const string BoardName = "BoardName";
public const string SyncSettings = "SyncSettings";
public const string LoopOffset = "LoopOffset";
public const string VBlankCount = "VBlankCount";
public const string CycleCount = "CycleCount";
public const string Core = "Core";

View File

@ -190,32 +190,6 @@ namespace BizHawk.Client.Common
}
}
protected int? LoopOffset
{
get
{
var offsetStr = Header[HeaderKeys.LoopOffset];
if (!string.IsNullOrWhiteSpace(offsetStr))
{
return int.Parse(offsetStr);
}
return null;
}
set
{
if (value.HasValue)
{
Header[HeaderKeys.LoopOffset] = value.ToString();
}
else
{
Header.Remove(HeaderKeys.LoopOffset);
}
}
}
protected string CommentsString()
{
var sb = new StringBuilder();

View File

@ -28,30 +28,9 @@ namespace BizHawk.Client.Common
public string GetInputLogEntry(int frame)
{
if (frame < FrameCount && frame >= 0)
{
int getFrame;
if (LoopOffset.HasValue)
{
if (frame < Log.Count)
{
getFrame = frame;
}
else
{
getFrame = ((frame - LoopOffset.Value) % (Log.Count - LoopOffset.Value)) + LoopOffset.Value;
}
}
else
{
getFrame = frame;
}
return Log[getFrame];
}
return "";
return frame < FrameCount && frame >= 0
? Log[frame]
: "";
}
public virtual bool ExtractInputLog(TextReader reader, out string errorMessage)

View File

@ -44,19 +44,7 @@ namespace BizHawk.Client.Common
return new Bk2LogEntryGenerator(Global.Emulator.SystemId, source);
}
public double FrameCount
{
get
{
if (LoopOffset.HasValue)
{
return double.PositiveInfinity;
}
return Log.Count;
}
}
public int FrameCount => Log.Count;
public int InputLogLength => Log.Count;
public ulong TimeLength
@ -123,26 +111,7 @@ namespace BizHawk.Client.Common
if (frame < FrameCount && frame >= 0)
{
_adapter ??= new Bk2Controller(Global.MovieSession.MovieController.Definition);
int getFrame;
if (LoopOffset.HasValue)
{
if (frame < Log.Count)
{
getFrame = frame;
}
else
{
getFrame = ((frame - LoopOffset.Value) % (Log.Count - LoopOffset.Value)) + LoopOffset.Value;
}
}
else
{
getFrame = frame;
}
_adapter.SetFromMnemonic(Log[getFrame]);
_adapter.SetFromMnemonic(Log[frame]);
return _adapter;
}

View File

@ -46,12 +46,12 @@ namespace BizHawk.Client.Common
/// <summary>
/// Gets the total number of frames that count towards the completion time of the movie
/// Possibly (but unlikely different from InputLogLength (could be infinity, or maybe an implementation automatically discounts empty frames at the end of a movie, etc)
/// </summary>
double FrameCount { get; }
int FrameCount { get; }
/// <summary>
/// Gets the actual length of the input log, should only be used by code that iterates or needs a real length
/// Gets the actual length of the input log, should only be used by code that needs a the input log length
/// specifically, not the frame count
/// </summary>
int InputLogLength { get; }