From 3548ec00dc3180b9c3ae707314e946a6f0c07b5d Mon Sep 17 00:00:00 2001 From: feos Date: Fri, 13 Jan 2017 18:26:52 +0300 Subject: [PATCH] tastudio: use Emulator the same way branch control uses it this fixes a bug that generated a whole stack of temp fixes over temp fixes, as well as the crash those were trying to prevent --- BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs | 8 ++------ .../tools/TAStudio/TAStudio.Designer.cs | 1 - BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs index ba6a7a5f4b..2efad67f96 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs @@ -16,7 +16,6 @@ namespace BizHawk.Client.EmuHawk public partial class MarkerControl : UserControl { public TAStudio Tastudio { get; set; } - public IEmulator Emulator { get; set; } public TasMovieMarkerList Markers { get { return Tastudio.CurrentTasMovie.Markers; } } public MarkerControl() @@ -52,10 +51,7 @@ namespace BizHawk.Client.EmuHawk private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color) { - var prev = Markers.PreviousOrCurrent(0); - - if (this.Emulator!=null) //Temp fix - prev = Markers.PreviousOrCurrent(Emulator.Frame); + var prev = Markers.PreviousOrCurrent(Tastudio.Emulator.Frame); if (prev != null && index == Markers.IndexOf(prev)) { @@ -164,7 +160,7 @@ namespace BizHawk.Client.EmuHawk public void AddMarker(bool editText = false, int? frame = null) { // feos: we specify the selected frame if we call this from TasView, otherwise marker should be added to the emulated frame - var markerFrame = frame ?? Emulator.Frame; + var markerFrame = frame ?? Tastudio.Emulator.Frame; if (editText) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index ad7cd4017a..ff7138d709 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -1315,7 +1315,6 @@ namespace BizHawk.Client.EmuHawk this.MarkerControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.MarkerControl.Emulator = null; this.MarkerControl.Location = new System.Drawing.Point(2, 16); this.MarkerControl.Name = "MarkerControl"; this.MarkerControl.Size = new System.Drawing.Size(194, 193); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 7f2ed3ac17..ad2b599b1e 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -140,7 +140,6 @@ namespace BizHawk.Client.EmuHawk TasPlaybackBox.Tastudio = this; MarkerControl.Tastudio = this; BookMarkControl.Tastudio = this; - MarkerControl.Emulator = this.Emulator; TasView.QueryItemText += TasView_QueryItemText; TasView.QueryItemBkColor += TasView_QueryItemBkColor; TasView.QueryRowBkColor += TasView_QueryRowBkColor;