From 2fbcaba8f48ec698a055dddcc6674b35b70831b2 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 6 Dec 2016 10:49:55 -0600 Subject: [PATCH] Multihawk - pass the Emulator instance into the RecordMovie dialog instead of using Global.Emulator --- BizHawk.Client.MultiHawk/Mainform.cs | 2 +- BizHawk.Client.MultiHawk/movie/RecordMovie.cs | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/BizHawk.Client.MultiHawk/Mainform.cs b/BizHawk.Client.MultiHawk/Mainform.cs index 25c5a29e14..ac66217f20 100644 --- a/BizHawk.Client.MultiHawk/Mainform.cs +++ b/BizHawk.Client.MultiHawk/Mainform.cs @@ -1121,7 +1121,7 @@ namespace BizHawk.Client.MultiHawk private void RecordMovieMenuItem_Click(object sender, EventArgs e) { - new RecordMovie().ShowDialog(); + new RecordMovie(Emulator).ShowDialog(); UpdateMainText(); UpdateAfterFrameChanged(); } diff --git a/BizHawk.Client.MultiHawk/movie/RecordMovie.cs b/BizHawk.Client.MultiHawk/movie/RecordMovie.cs index 457ba481b2..4c5cdb4e66 100644 --- a/BizHawk.Client.MultiHawk/movie/RecordMovie.cs +++ b/BizHawk.Client.MultiHawk/movie/RecordMovie.cs @@ -13,12 +13,16 @@ namespace BizHawk.Client.MultiHawk { public partial class RecordMovie : Form { + private IEmulator Emulator; + // TODO - Allow relative paths in record textbox - public RecordMovie() + public RecordMovie(IEmulator core) { InitializeComponent(); - if (!Global.Emulator.HasSavestates()) + Emulator = core; + + if (!Emulator.HasSavestates()) { StartFromCombo.Items.Remove( StartFromCombo.Items @@ -77,9 +81,9 @@ namespace BizHawk.Client.MultiHawk Directory.CreateDirectory(fileInfo.DirectoryName); } - //if (StartFromCombo.SelectedItem.ToString() == "Now" && Global.Emulator.HasSavestates()) + //if (StartFromCombo.SelectedItem.ToString() == "Now" && Emulator.HasSavestates()) //{ - // var core = Global.Emulator.AsStatable(); + // var core = Emulator.AsStatable(); // movieToRecord.StartsFromSavestate = true; @@ -103,7 +107,7 @@ namespace BizHawk.Client.MultiHawk // if (movieToRecord.SavestateFramebuffer != null) // { - // movieToRecord.SavestateFramebuffer = (int[])Global.Emulator.VideoProvider().GetVideoBuffer().Clone(); + // movieToRecord.SavestateFramebuffer = (int[])Emulator.VideoProvider().GetVideoBuffer().Clone(); // } // } //}