tastudio: various fixes.

- saving and loading tasproj markers
- flagging changes after branch operations
- clearing InputRoll selection
This commit is contained in:
feos 2015-09-13 11:44:15 +03:00
parent 5406fc9cfa
commit 4fd55da52a
4 changed files with 18 additions and 5 deletions

View File

@ -62,7 +62,7 @@ namespace BizHawk.Client.Common
public static BinaryStateLump BranchLagLog { get; private set; }
[Name("Branches\\Header", "json")]
public static BinaryStateLump BranchHeader { get; private set; }
[Name("Branches\\Markers", "markers")]
[Name("Branches\\Markers", "txt")]
public static BinaryStateLump BranchMarkers { get; private set; }

View File

@ -40,20 +40,24 @@ namespace BizHawk.Client.Common
TimeStamp = b.TimeStamp
}));
});
bs.PutLump(ncore, delegate(Stream s)
{
s.Write(b.CoreData, 0, b.CoreData.Length);
});
bs.PutLump(ninput, delegate(TextWriter tw)
{
foreach (var line in b.InputLog)
tw.WriteLine(line);
});
bs.PutLump(nframebuffer, delegate(Stream s)
{
var vp = new BitmapBufferVideoProvider(b.OSDFrameBuffer);
QuickBmpFile.Save(vp, s, b.OSDFrameBuffer.Width, b.OSDFrameBuffer.Height);
});
bs.PutLump(nlaglog, delegate(BinaryWriter bw)
{
b.LagLog.Save(bw);
@ -69,6 +73,7 @@ namespace BizHawk.Client.Common
ninput.Increment();
nframebuffer.Increment();
nlaglog.Increment();
nmarkers.Increment();
}
}
@ -79,7 +84,7 @@ namespace BizHawk.Client.Common
var ninput = new IndexedStateLump(BinaryStateLump.BranchInputLog);
var nframebuffer = new IndexedStateLump(BinaryStateLump.BranchFrameBuffer);
var nlaglog = new IndexedStateLump(BinaryStateLump.BranchLagLog);
var nmarkers = new IndexedStateLump(BinaryStateLump.Markers);
var nmarkers = new IndexedStateLump(BinaryStateLump.BranchMarkers);
Clear();
@ -154,6 +159,7 @@ namespace BizHawk.Client.Common
ninput.Increment();
nframebuffer.Increment();
nlaglog.Increment();
nmarkers.Increment();
}
}
}

View File

@ -473,15 +473,16 @@ namespace BizHawk.Client.Common
int? divergentPoint = DivergantPoint(_log, branch.InputLog);
_log = branch.InputLog.ToList();
_changes = true;
//_changes = true;
LagLog.FromLagLog(branch.LagLog);
StateManager.LoadBranch(Branches.IndexOf(branch));
StateManager.SetState(branch.Frame, branch.CoreData);
ChangeLog = branch.ChangeLog;
//ChangeLog = branch.ChangeLog;
Markers = branch.Markers;
Changes = true;
}
// TODO: use LogGenerators rather than string comparisons
@ -508,12 +509,14 @@ namespace BizHawk.Client.Common
{
Branches.Add(branch);
TasStateManager.AddBranch();
Changes = true;
}
public void RemoveBranch(TasBranch branch)
{
TasStateManager.RemoveBranch(Branches.IndexOf(branch));
Branches.Remove(branch);
Changes = true;
}
public void UpdateBranch(TasBranch old, TasBranch newBranch)
@ -521,6 +524,7 @@ namespace BizHawk.Client.Common
int index = Branches.IndexOf(old);
Branches[index] = newBranch;
TasStateManager.UpdateBranch(index);
Changes = true;
}
public void SwapBranches(int b1, int b2)
@ -532,6 +536,7 @@ namespace BizHawk.Client.Common
Branches.Remove(branch);
Branches.Insert(b2, branch);
Changes = true;
}
}
}

View File

@ -453,9 +453,11 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.ClearChanges(); // Don't ask to save changes here.
HandleMovieLoadStuff();
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always.
// clear all selections
TasView.DeselectAll();
BookMarkControl.Restart();
MarkerControl.Restart();
RefreshDialog();
}
}