Skip to content

Commit

Permalink
tastudio: fuck this
Browse files Browse the repository at this point in the history
  • Loading branch information
feos committed Feb 20, 2018
1 parent 92ec683 commit 7ae374d
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 675 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static TasMovie ConvertToSavestateAnchoredMovie(this TasMovie old, int fr
// States can't be easily moved over, because they contain the frame number.
// TODO? I'm not sure how this would be done.
tas.TasStateManager.MountWriteAccess();
old.TasStateManager.Clear();
old.TasStateManager.ClearStateHistory();

// Lag Log
tas.TasLagLog.FromLagLog(old.TasLagLog);
Expand Down Expand Up @@ -221,7 +221,7 @@ public static TasMovie ConvertToSaveRamAnchoredMovie(this TasMovie old, byte[] s
}

var tas = new TasMovie(newFilename, true) { SaveRam = saveRam };
tas.TasStateManager.Clear();
tas.TasStateManager.ClearStateHistory();
tas.ClearLagLog();

var entries = old.GetLogEntries();
Expand Down
13 changes: 1 addition & 12 deletions BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ protected override void Write(string fn, bool backup = false)
if (Branches.Any())
{
Branches.Save(bs);
if (_stateManager.Settings.BranchStatesInTasproj)
{
bs.PutLump(BinaryStateLump.BranchStateHistory, (BinaryWriter bw) => _stateManager.SaveBranchStates(bw));
}
}

bs.PutLump(BinaryStateLump.Session, tw => tw.WriteLine(Session.ToString()));
Expand Down Expand Up @@ -245,13 +241,6 @@ public override bool Load(bool preload)
});

Branches.Load(bl, this);
if (_stateManager.Settings.BranchStatesInTasproj)
{
bl.GetLump(BinaryStateLump.BranchStateHistory, false, delegate(BinaryReader br, long length)
{
_stateManager.LoadBranchStates(br);
});
}

bl.GetLump(BinaryStateLump.Session, false, delegate(TextReader tr)
{
Expand Down Expand Up @@ -283,7 +272,7 @@ public override bool Load(bool preload)
private void ClearTasprojExtras()
{
_lagLog.Clear();
_stateManager.Clear();
_stateManager.ClearStateHistory();
Markers.Clear();
ChangeLog.ClearLog();
}
Expand Down
6 changes: 0 additions & 6 deletions BizHawk.Client.Common/movie/tasproj/TasMovie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,11 @@ public int BranchIndexByFrame(int frame)
public void AddBranch(TasBranch branch)
{
Branches.Add(branch);
TasStateManager.AddBranch();
Changes = true;
}

public void RemoveBranch(TasBranch branch)
{
TasStateManager.RemoveBranch(Branches.IndexOf(branch));
Branches.Remove(branch);
Changes = true;
}
Expand All @@ -527,9 +525,6 @@ public void LoadBranch(TasBranch branch)
{
_stateManager.Invalidate(branch.InputLog.Count);
}

_stateManager.LoadBranch(Branches.IndexOf(branch));
_stateManager.SetState(branch.Frame, branch.CoreData);

if (BindMarkersToInput) // pretty critical not to erase them
{
Expand All @@ -549,7 +544,6 @@ public void UpdateBranch(TasBranch old, TasBranch newBranch)
}

Branches[index] = newBranch;
TasStateManager.UpdateBranch(index);
Changes = true;
}

Expand Down
Loading

0 comments on commit 7ae374d

Please sign in to comment.