From 8799f27f60b16b04dbd98ae355f3b0adb3fbd6c2 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 2 Aug 2014 17:49:10 +0000 Subject: [PATCH] Rip out the sync settings hack --- BizHawk.Client.Common/movie/MovieSession.cs | 9 --------- BizHawk.Client.EmuHawk/MainForm.cs | 16 +++++++++------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index d66124632c..5a5380dcc0 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -35,9 +35,6 @@ namespace BizHawk.Client.Common get { return QueuedMovie != null; } } - //TODO: this shouldn't be a hack anymore, the contents of this should be reliably in QueuedMovie - public object SyncSettingsHack { get; set; } - public MultitrackRecording MultiTrack { get { return _multiTrack; } } public IMovieController MovieControllerAdapter{ get; set; } @@ -482,12 +479,6 @@ namespace BizHawk.Client.Common } } - var s = Global.MovieSession.Movie.SyncSettingsJson; - if (!string.IsNullOrWhiteSpace(s)) - { - SyncSettingsHack = ConfigService.LoadWithType(s); - } - if (record) // This is a hack really, we need to set the movie to its propert state so that it will be considered active later { movie.SwitchToRecord(); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 2dca3e7ce5..3104cf0a3f 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1836,11 +1836,15 @@ namespace BizHawk.Client.EmuHawk private void CoreSyncSettings(object sender, RomLoader.SettingsLoadArgs e) { - // _syncSetting solely exists because of a bad and confusing workflow - // A movie is loaded, then load rom is called, which closes the current rom which closes the current movie (which is the movie just loaded) - // As such the movie is "inactive". So instead we load the movie and populate the _syncSettingsHack - // Then let the rom logic work its magic, then use it here, as such it will be null unless a movie invoked the load rom call - e.Settings = Global.MovieSession.SyncSettingsHack ?? Global.Config.GetCoreSyncSettings(e.Core); + if (Global.MovieSession.QueuedMovie != null) + { + e.Settings = ConfigService.LoadWithType(Global.MovieSession.QueuedMovie.SyncSettingsJson); + } + else + { + e.Settings = Global.Config.GetCoreSyncSettings(e.Core); + } + } private static void CoreSettings(object sender, RomLoader.SettingsLoadArgs e) @@ -3022,8 +3026,6 @@ namespace BizHawk.Client.EmuHawk private void ShowLoadError(object sender, RomLoader.RomErrorArgs e) { - Global.MovieSession.SyncSettingsHack = null; // ensure subsequent calls to LoadRom won't get the settings object created here - if (e.Type == RomLoader.LoadErrorType.MissingFirmware) { var result = MessageBox.Show(