tidy some oddities with the scanline filter

This commit is contained in:
zeromus 2015-10-15 20:10:35 -05:00
parent 529ec876a2
commit 7f5546fac4
3 changed files with 29 additions and 31 deletions

View File

@ -182,7 +182,6 @@ namespace BizHawk.Client.EmuHawk
selectedChain = ShaderChain_hq2x; selectedChain = ShaderChain_hq2x;
if (Global.Config.TargetDisplayFilter == 2 && ShaderChain_scanlines != null && ShaderChain_scanlines.Available) 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; selectedChain = ShaderChain_scanlines;
selectedChainProperties["uIntensity"] = 1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f; selectedChainProperties["uIntensity"] = 1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f;
} }

View File

@ -36,7 +36,6 @@
this.lblUserFilterName = new System.Windows.Forms.Label(); this.lblUserFilterName = new System.Windows.Forms.Label();
this.btnSelectUserFilter = new System.Windows.Forms.Button(); this.btnSelectUserFilter = new System.Windows.Forms.Button();
this.rbUser = new System.Windows.Forms.RadioButton(); this.rbUser = new System.Windows.Forms.RadioButton();
this.tbScanlineIntensity = new BizHawk.Client.EmuHawk.TransparentTrackBar();
this.rbNone = new System.Windows.Forms.RadioButton(); this.rbNone = new System.Windows.Forms.RadioButton();
this.rbScanlines = new System.Windows.Forms.RadioButton(); this.rbScanlines = new System.Windows.Forms.RadioButton();
this.rbHq2x = new System.Windows.Forms.RadioButton(); this.rbHq2x = new System.Windows.Forms.RadioButton();
@ -88,11 +87,11 @@
this.cbStatusBarWindowed = new System.Windows.Forms.CheckBox(); this.cbStatusBarWindowed = new System.Windows.Forms.CheckBox();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.cbMenuWindowed = new System.Windows.Forms.CheckBox(); this.cbMenuWindowed = new System.Windows.Forms.CheckBox();
this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar();
this.cbCaptionWindowed = new System.Windows.Forms.CheckBox(); this.cbCaptionWindowed = new System.Windows.Forms.CheckBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.tbScanlineIntensity = new BizHawk.Client.EmuHawk.TransparentTrackBar();
this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
this.grpFinalFilter.SuspendLayout(); this.grpFinalFilter.SuspendLayout();
this.grpARSelection.SuspendLayout(); this.grpARSelection.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
@ -105,6 +104,7 @@
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -186,19 +186,6 @@
this.rbUser.Text = "User"; this.rbUser.Text = "User";
this.rbUser.UseVisualStyleBackColor = true; 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 // rbNone
// //
this.rbNone.AutoSize = true; this.rbNone.AutoSize = true;
@ -766,17 +753,6 @@
this.cbMenuWindowed.Text = "Menu"; this.cbMenuWindowed.Text = "Menu";
this.cbMenuWindowed.UseVisualStyleBackColor = true; 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 // cbCaptionWindowed
// //
this.cbCaptionWindowed.AutoSize = true; this.cbCaptionWindowed.AutoSize = true;
@ -798,6 +774,30 @@
this.linkLabel1.Text = "Documentation"; this.linkLabel1.Text = "Documentation";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 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 // DisplayConfigLite
// //
this.AcceptButton = this.btnOk; this.AcceptButton = this.btnOk;
@ -815,7 +815,6 @@
this.Text = "Display Configuration"; this.Text = "Display Configuration";
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit();
this.grpFinalFilter.ResumeLayout(false); this.grpFinalFilter.ResumeLayout(false);
this.grpFinalFilter.PerformLayout(); this.grpFinalFilter.PerformLayout();
this.grpARSelection.ResumeLayout(false); this.grpARSelection.ResumeLayout(false);
@ -837,6 +836,7 @@
this.groupBox4.PerformLayout(); this.groupBox4.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -210,8 +210,7 @@ namespace BizHawk.Client.EmuHawk.config
{ {
Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value; Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value;
int scanlines = Global.Config.TargetScanlineFilterIntensity; int scanlines = Global.Config.TargetScanlineFilterIntensity;
float percentage = (float) scanlines / 255 * 100; float percentage = (float) scanlines / 256 * 100;
if (percentage > 100) percentage = 100;
lblScanlines.Text = String.Format("{0:F2}", percentage) + "%"; lblScanlines.Text = String.Format("{0:F2}", percentage) + "%";
} }