tastudio: tie rerecording to laglog invalidation instead of states.

This commit is contained in:
feos 2016-04-18 18:52:02 +03:00
parent 643e475ccc
commit 1581b5b283
2 changed files with 7 additions and 3 deletions

View File

@ -79,10 +79,14 @@ namespace BizHawk.Client.Common
LagLog.Clear();
}
public void RemoveFrom(int frame)
public bool RemoveFrom(int frame)
{
if (LagLog.Count > frame && frame >= 0)
{
LagLog.RemoveRange(frame + 1, LagLog.Count - frame - 1);
return true;
}
return false;
}
public void RemoveHistoryAt(int frame)

View File

@ -224,8 +224,8 @@ namespace BizHawk.Client.Common
/// <param name="frame">The last frame that can be valid.</param>
private void InvalidateAfter(int frame)
{
LagLog.RemoveFrom(frame);
var anyInvalidated = StateManager.Invalidate(frame + 1);
var anyInvalidated = LagLog.RemoveFrom(frame);
StateManager.Invalidate(frame + 1);
Changes = true; // TODO check if this actually removed anything before flagging changes
if (anyInvalidated && Global.MovieSession.Movie.IsCountingRerecords)