From 270d03bf403afaa21af75c356bb38039095fa5e3 Mon Sep 17 00:00:00 2001
From: adelikat <adelikat@tasvideos.org>
Date: Fri, 19 Jun 2020 14:35:55 -0500
Subject: [PATCH] rewind - change UseDeltaCompression to UseCompression

---
 .../config/RewindConfig.cs                    |  4 ++--
 src/BizHawk.Client.Common/rewind/Zwinder.cs   |  3 +--
 .../config/RewindConfig.Designer.cs           | 22 +++++++++----------
 .../config/RewindConfig.cs                    |  6 ++---
 4 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/BizHawk.Client.Common/config/RewindConfig.cs b/src/BizHawk.Client.Common/config/RewindConfig.cs
index 89c4226004..5d10811241 100644
--- a/src/BizHawk.Client.Common/config/RewindConfig.cs
+++ b/src/BizHawk.Client.Common/config/RewindConfig.cs
@@ -4,7 +4,7 @@ namespace BizHawk.Client.Common
 {
 	public interface IRewindSettings
 	{
-		public bool UseDelta { get; }
+		public bool UseCompression { get; }
 		public bool EnabledSmall { get; }
 		public bool EnabledMedium { get; }
 		public bool EnabledLarge { get; }
@@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
 
 	public class RewindConfig : IRewindSettings
 	{
-		public bool UseDelta { get; set; } = true;
+		public bool UseCompression { get; set; }
 		public bool EnabledSmall { get; set; } = true;
 		public bool EnabledMedium { get; set; }
 		public bool EnabledLarge { get; set; }
diff --git a/src/BizHawk.Client.Common/rewind/Zwinder.cs b/src/BizHawk.Client.Common/rewind/Zwinder.cs
index 8444cf2291..9881941adb 100644
--- a/src/BizHawk.Client.Common/rewind/Zwinder.cs
+++ b/src/BizHawk.Client.Common/rewind/Zwinder.cs
@@ -24,7 +24,6 @@ namespace BizHawk.Client.Common
 		public Zwinder(int targetFrameLength, IBinaryStateable stateSource, IRewindSettings settings)
 		{
 			long targetSize = settings.BufferSize * 1024 * 1024;
-			bool kompress = settings.UseDelta;
 			if (targetSize < 65536)
 				throw new ArgumentOutOfRangeException(nameof(targetSize));
 			if (targetFrameLength < 1)
@@ -37,7 +36,7 @@ namespace BizHawk.Client.Common
 			_stateSource = stateSource;
 			_targetFrameLength = targetFrameLength;
 			_states = new StateInfo[STATEMASK + 1];
-			_kompress = kompress;
+			_kompress = settings.UseCompression;
 		}
 
 		/// <summary>
diff --git a/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs b/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs
index 7b1b4c7e6a..0db4206bdb 100644
--- a/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs
+++ b/src/BizHawk.Client.EmuHawk/config/RewindConfig.Designer.cs
@@ -48,7 +48,7 @@
             this.SmallLabel2 = new System.Windows.Forms.Label();
             this.SmallLabel3 = new System.Windows.Forms.Label();
             this.SmallSavestateNumeric = new System.Windows.Forms.NumericUpDown();
-            this.UseDeltaCompression = new System.Windows.Forms.CheckBox();
+            this.UseCompression = new System.Windows.Forms.CheckBox();
             this.label1 = new System.Windows.Forms.Label();
             this.StateSizeLabel = new System.Windows.Forms.Label();
             this.MediumStateTrackbar = new System.Windows.Forms.TrackBar();
@@ -362,14 +362,14 @@
             // 
             // UseDeltaCompression
             // 
-            this.UseDeltaCompression.AutoSize = true;
-            this.UseDeltaCompression.Location = new System.Drawing.Point(16, 89);
-            this.UseDeltaCompression.Name = "UseDeltaCompression";
-            this.UseDeltaCompression.Size = new System.Drawing.Size(332, 17);
-            this.UseDeltaCompression.TabIndex = 5;
-            this.UseDeltaCompression.Text = "Use delta compression (economizes buffer usage at cost of CPU)";
-            this.UseDeltaCompression.UseVisualStyleBackColor = true;
-            this.UseDeltaCompression.CheckedChanged += new System.EventHandler(this.UseDeltaCompression_CheckedChanged);
+            this.UseCompression.AutoSize = true;
+            this.UseCompression.Location = new System.Drawing.Point(16, 89);
+            this.UseCompression.Name = "UseCompression";
+            this.UseCompression.Size = new System.Drawing.Size(332, 17);
+            this.UseCompression.TabIndex = 5;
+            this.UseCompression.Text = "Use compression (economizes buffer usage at cost of CPU)";
+            this.UseCompression.UseVisualStyleBackColor = true;
+            this.UseCompression.CheckedChanged += new System.EventHandler(this.UseDeltaCompression_CheckedChanged);
             // 
             // label1
             // 
@@ -525,7 +525,7 @@
             this.groupBox3.Controls.Add(this.BufferSizeUpDown);
             this.groupBox3.Controls.Add(this.label3);
             this.groupBox3.Controls.Add(this.DiskBufferCheckbox);
-            this.groupBox3.Controls.Add(this.UseDeltaCompression);
+            this.groupBox3.Controls.Add(this.UseCompression);
             this.groupBox3.Location = new System.Drawing.Point(12, 214);
             this.groupBox3.Name = "groupBox3";
             this.groupBox3.Size = new System.Drawing.Size(371, 167);
@@ -1043,7 +1043,7 @@
 		private System.Windows.Forms.CheckBox LargeStateEnabledBox;
 		private System.Windows.Forms.CheckBox MediumStateEnabledBox;
 		private System.Windows.Forms.CheckBox SmallStateEnabledBox;
-		private System.Windows.Forms.CheckBox UseDeltaCompression;
+		private System.Windows.Forms.CheckBox UseCompression;
 		private System.Windows.Forms.Label label1;
 		private System.Windows.Forms.Label StateSizeLabel;
 		private System.Windows.Forms.TrackBar MediumStateTrackbar;
diff --git a/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs b/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs
index 6f92a5768d..04739f621e 100644
--- a/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs
+++ b/src/BizHawk.Client.EmuHawk/config/RewindConfig.cs
@@ -48,7 +48,7 @@ namespace BizHawk.Client.EmuHawk
 			_mediumStateSize = _config.Rewind.MediumStateSize;
 			_largeStateSize = _config.Rewind.LargeStateSize;
 
-			UseDeltaCompression.Checked = _config.Rewind.UseDelta;
+			UseCompression.Checked = _config.Rewind.UseCompression;
 
 			SmallSavestateNumeric.Value = _config.Rewind.FrequencySmall;
 			MediumSavestateNumeric.Value = _config.Rewind.FrequencyMedium;
@@ -160,7 +160,7 @@ namespace BizHawk.Client.EmuHawk
 		private void Ok_Click(object sender, EventArgs e)
 		{
 			// These settings are used by DoRewindSettings, which we'll only call if anything actually changed (i.e. preserve rewind history if possible)
-			_config.Rewind.UseDelta = PutRewindSetting(_config.Rewind.UseDelta, UseDeltaCompression.Checked);
+			_config.Rewind.UseCompression = PutRewindSetting(_config.Rewind.UseCompression, UseCompression.Checked);
 			_config.Rewind.EnabledSmall = PutRewindSetting(_config.Rewind.EnabledSmall, SmallStateEnabledBox.Checked);
 			_config.Rewind.EnabledMedium = PutRewindSetting(_config.Rewind.EnabledMedium, MediumStateEnabledBox.Checked);
 			_config.Rewind.EnabledLarge = PutRewindSetting(_config.Rewind.EnabledLarge, LargeStateEnabledBox.Checked);
@@ -309,7 +309,7 @@ namespace BizHawk.Client.EmuHawk
 		{
 			long avgStateSize;
 
-			if (UseDeltaCompression.Checked || _stateSize == 0)
+			if (UseCompression.Checked || _stateSize == 0)
 			{
 				if (_mainForm.Rewinder?.Count > 0)
 				{