Fix bugs in last commit

This commit is contained in:
adelikat 2014-11-02 01:10:19 +00:00
parent f7460d1821
commit 7f18d9ebc0
2 changed files with 10 additions and 8 deletions

View File

@ -8,9 +8,9 @@ namespace BizHawk.Client.Common
{
public void RemoveFrom(int frame)
{
if (frame > 0 && frame < this.Count)
if (frame > 0 && frame <= this.Count)
{
this.RemoveRange(frame - 1, this.Count - frame);
this.RemoveRange(frame - 1, this.Count - (frame - 1));
}
}

View File

@ -287,14 +287,16 @@ namespace BizHawk.Client.Common
public override IController GetInputState(int frame)
{
// TODO: states and lag capture
if (Global.Emulator.Frame - 1 == frame)
{
if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary<int, bool> with frame values?
{
LagLog.Add(Global.Emulator.IsLagFrame);
}
}
if (Global.Emulator.Frame == frame) // Take this opportunity to capture lag and state info if we do not have it
{
// TODO
//if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary<int, bool> with frame values?
//{
// LagLog.Add(Global.Emulator.IsLagFrame);
//}
if (!StateManager.HasState(frame))
{