From 7f5546fac4b88bfc288446e95a3fca0230f40b7e Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 15 Oct 2015 20:10:35 -0500 Subject: [PATCH] tidy some oddities with the scanline filter --- .../DisplayManager/DisplayManager.cs | 1 - .../config/DisplayConfigLite.Designer.cs | 56 +++++++++---------- .../config/DisplayConfigLite.cs | 3 +- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index 90e4d6fec0..f721d92b88 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -182,7 +182,6 @@ namespace BizHawk.Client.EmuHawk selectedChain = ShaderChain_hq2x; if (Global.Config.TargetDisplayFilter == 2 && ShaderChain_scanlines != null && ShaderChain_scanlines.Available) { - //shader.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f); selectedChain = ShaderChain_scanlines; selectedChainProperties["uIntensity"] = 1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f; } diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs index e289e4bcd2..070a3a62c5 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs @@ -36,7 +36,6 @@ this.lblUserFilterName = new System.Windows.Forms.Label(); this.btnSelectUserFilter = new System.Windows.Forms.Button(); this.rbUser = new System.Windows.Forms.RadioButton(); - this.tbScanlineIntensity = new BizHawk.Client.EmuHawk.TransparentTrackBar(); this.rbNone = new System.Windows.Forms.RadioButton(); this.rbScanlines = new System.Windows.Forms.RadioButton(); this.rbHq2x = new System.Windows.Forms.RadioButton(); @@ -88,11 +87,11 @@ this.cbStatusBarWindowed = new System.Windows.Forms.CheckBox(); this.label9 = new System.Windows.Forms.Label(); this.cbMenuWindowed = new System.Windows.Forms.CheckBox(); - this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar(); this.cbCaptionWindowed = new System.Windows.Forms.CheckBox(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.tbScanlineIntensity = new BizHawk.Client.EmuHawk.TransparentTrackBar(); + this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar(); this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit(); this.grpFinalFilter.SuspendLayout(); this.grpARSelection.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -105,6 +104,7 @@ this.tabPage1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).BeginInit(); this.SuspendLayout(); // @@ -186,19 +186,6 @@ this.rbUser.Text = "User"; this.rbUser.UseVisualStyleBackColor = true; // - // tbScanlineIntensity - // - this.tbScanlineIntensity.LargeChange = 32; - this.tbScanlineIntensity.Location = new System.Drawing.Point(83, 55); - this.tbScanlineIntensity.Maximum = 256; - this.tbScanlineIntensity.Name = "tbScanlineIntensity"; - this.tbScanlineIntensity.Size = new System.Drawing.Size(70, 42); - this.tbScanlineIntensity.TabIndex = 3; - this.tbScanlineIntensity.TickFrequency = 32; - this.tbScanlineIntensity.TickStyle = System.Windows.Forms.TickStyle.TopLeft; - this.tbScanlineIntensity.Scroll += new System.EventHandler(this.tbScanlineIntensity_Scroll); - this.tbScanlineIntensity.ValueChanged += new System.EventHandler(this.tbScanlineIntensity_Scroll); - // // rbNone // this.rbNone.AutoSize = true; @@ -766,17 +753,6 @@ this.cbMenuWindowed.Text = "Menu"; this.cbMenuWindowed.UseVisualStyleBackColor = true; // - // trackbarFrameSizeWindowed - // - this.trackbarFrameSizeWindowed.LargeChange = 1; - this.trackbarFrameSizeWindowed.Location = new System.Drawing.Point(6, 33); - this.trackbarFrameSizeWindowed.Maximum = 2; - this.trackbarFrameSizeWindowed.Name = "trackbarFrameSizeWindowed"; - this.trackbarFrameSizeWindowed.Size = new System.Drawing.Size(99, 42); - this.trackbarFrameSizeWindowed.TabIndex = 21; - this.trackbarFrameSizeWindowed.Value = 1; - this.trackbarFrameSizeWindowed.ValueChanged += new System.EventHandler(this.trackbarFrameSizeWindowed_ValueChanged); - // // cbCaptionWindowed // this.cbCaptionWindowed.AutoSize = true; @@ -798,6 +774,30 @@ this.linkLabel1.Text = "Documentation"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // + // tbScanlineIntensity + // + this.tbScanlineIntensity.LargeChange = 32; + this.tbScanlineIntensity.Location = new System.Drawing.Point(83, 55); + this.tbScanlineIntensity.Maximum = 256; + this.tbScanlineIntensity.Name = "tbScanlineIntensity"; + this.tbScanlineIntensity.Size = new System.Drawing.Size(70, 42); + this.tbScanlineIntensity.TabIndex = 3; + this.tbScanlineIntensity.TickFrequency = 32; + this.tbScanlineIntensity.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + this.tbScanlineIntensity.Scroll += new System.EventHandler(this.tbScanlineIntensity_Scroll); + this.tbScanlineIntensity.ValueChanged += new System.EventHandler(this.tbScanlineIntensity_Scroll); + // + // trackbarFrameSizeWindowed + // + this.trackbarFrameSizeWindowed.LargeChange = 1; + this.trackbarFrameSizeWindowed.Location = new System.Drawing.Point(6, 33); + this.trackbarFrameSizeWindowed.Maximum = 2; + this.trackbarFrameSizeWindowed.Name = "trackbarFrameSizeWindowed"; + this.trackbarFrameSizeWindowed.Size = new System.Drawing.Size(99, 42); + this.trackbarFrameSizeWindowed.TabIndex = 21; + this.trackbarFrameSizeWindowed.Value = 1; + this.trackbarFrameSizeWindowed.ValueChanged += new System.EventHandler(this.trackbarFrameSizeWindowed_ValueChanged); + // // DisplayConfigLite // this.AcceptButton = this.btnOk; @@ -815,7 +815,6 @@ this.Text = "Display Configuration"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit(); this.grpFinalFilter.ResumeLayout(false); this.grpFinalFilter.PerformLayout(); this.grpARSelection.ResumeLayout(false); @@ -837,6 +836,7 @@ this.groupBox4.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs index 82e5093426..20eb6de13c 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs @@ -210,8 +210,7 @@ namespace BizHawk.Client.EmuHawk.config { Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value; int scanlines = Global.Config.TargetScanlineFilterIntensity; - float percentage = (float) scanlines / 255 * 100; - if (percentage > 100) percentage = 100; + float percentage = (float) scanlines / 256 * 100; lblScanlines.Text = String.Format("{0:F2}", percentage) + "%"; }