when loading a .bkm movie, automatically convert it to .bk2

This commit is contained in:
adelikat 2014-06-19 02:05:38 +00:00
parent 10fbf1a466
commit 31c219d44b
2 changed files with 10 additions and 5 deletions

View File

@ -31,8 +31,8 @@ namespace BizHawk.Client.Common
if (VersionInfo.DeveloperBuild)
{
//movie.Load();
return movie; //.ToBk2();
movie.Load();
return movie.ToBk2();
}
else
{

View File

@ -11,7 +11,7 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
public static Bk2Movie ToBk2(this BkmMovie bkm)
{
var newFilename = bkm.Filename + "." + Bk2Movie.Extension;
var bk2 = new Bk2Movie(bkm.Filename);
var bk2 = new Bk2Movie(newFilename);
bk2.HeaderEntries.Clear();
foreach(var kvp in bkm.HeaderEntries)
{
@ -32,8 +32,13 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
bk2.Subtitles.Add(sub);
}
// TODO: savestate
// TODO: input log
bk2.SavestateBinaryBase64Blob = bkm.SavestateBinaryBase64Blob;
for (int i = 0; i < bkm.InputLogLength; i++)
{
var input = bkm.GetInputState(i);
bk2.AppendFrame(input);
}
return bk2;
}