BinaryStateSaver - detangle version lump handling

This commit is contained in:
adelikat 2020-05-31 10:12:44 -05:00
parent 818748adce
commit 33696eb5df
2 changed files with 8 additions and 7 deletions

View File

@ -328,15 +328,15 @@ namespace BizHawk.Client.Common
sw.Flush();
}
public BinaryStateSaver(string path, bool notamovie = true) // notamovie is hack, really should have separate something
public BinaryStateSaver(string path, bool notamovie) // notamovie is hack, really should have separate something
{
_zip = new FrameworkZipWriter(path, notamovie ? Global.Config.SaveStateCompressionLevelNormal : Global.Config.MovieCompressionLevel);
}
if (notamovie)
{
PutLump(BinaryStateLump.Versiontag, WriteVersion);
PutLump(BinaryStateLump.BizVersion, WriteEmuVersion);
}
public void PutVersionLumps()
{
PutLump(BinaryStateLump.Versiontag, WriteVersion);
PutLump(BinaryStateLump.BizVersion, WriteEmuVersion);
}
public void PutLump(BinaryStateLump lump, Action<Stream> callback)

View File

@ -15,7 +15,8 @@ namespace BizHawk.Client.Common
// the old method of text savestate save is now gone.
// a text savestate is just like a binary savestate, but with a different core lump
using var bs = new BinaryStateSaver(filename);
using var bs = new BinaryStateSaver(filename, true);
bs.PutVersionLumps();
if (Global.Config.SaveStateType == SaveStateTypeE.Text)
{
// text savestate format