From 31c219d44b53a83a7997dc16d9f8a1a69ed3ecdf Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 19 Jun 2014 02:05:38 +0000 Subject: [PATCH] when loading a .bkm movie, automatically convert it to .bk2 --- BizHawk.Client.Common/movie/MovieService.cs | 4 ++-- .../movie/conversions/MovieConversionExtensions.cs | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BizHawk.Client.Common/movie/MovieService.cs b/BizHawk.Client.Common/movie/MovieService.cs index 280cf25223..4f0fbde76d 100644 --- a/BizHawk.Client.Common/movie/MovieService.cs +++ b/BizHawk.Client.Common/movie/MovieService.cs @@ -31,8 +31,8 @@ namespace BizHawk.Client.Common if (VersionInfo.DeveloperBuild) { - //movie.Load(); - return movie; //.ToBk2(); + movie.Load(); + return movie.ToBk2(); } else { diff --git a/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs b/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs index 95a6e7c70c..16dfb79fb8 100644 --- a/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs +++ b/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs @@ -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; }