minimal implementation of AR correction. this isn't completely satisfying. we need to run the frontend 1x/2x/etc sizing through it, and I'm feeling like we need two tiers of AR suggestion strengths.. we may want a2600 fixing AR out of the box, but NES fixing AR by default is unacceptable

This commit is contained in:
zeromus 2014-05-02 04:27:08 +00:00
parent 00a1f8a3ba
commit d2232e616b
6 changed files with 39 additions and 9 deletions

View File

@ -167,6 +167,7 @@ namespace BizHawk.Client.Common
public bool DispBlurry = false; // make display look ugly
public bool DispFixAspectRatio = true;
public bool DispFixScaleInteger = false;
public bool DispObeyAR = false;
// Sound options
public bool SoundEnabled = true;

View File

@ -259,6 +259,14 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
public void UpdateSource(IVideoProvider videoProvider)
{
int vw = videoProvider.BufferWidth;
int vh = videoProvider.BufferHeight;
if (Global.Config.DispObeyAR)
{
vw = videoProvider.VirtualWidth;
vh = videoProvider.VirtualHeight;
}
int[] videoBuffer = videoProvider.GetVideoBuffer();
TESTEROO:
@ -280,6 +288,7 @@ TESTEROO:
//now, acquire the data sent from the videoProvider into a texture
videoTexture = VideoTextureFrugalizer.Get(bb);
GL.SetTextureWrapMode(videoTexture, true);
}
//TEST (to be removed once we have an actual example of bring in a texture ID from opengl emu core):
@ -294,7 +303,7 @@ TESTEROO:
currEmuHeight = bufferHeight;
//build the default filter chain and set it up with services filters will need
Size chain_insize = new Size(bufferWidth, bufferHeight);
Size chain_insize = new Size(vw, vh);
Size chain_outsize = GraphicsControl.Size;
CurrentFilterProgram = BuildDefaultChain(chain_insize, chain_outsize);
CurrentFilterProgram.GuiRenderer = Renderer;

View File

@ -152,8 +152,8 @@ namespace BizHawk.Client.EmuHawk.Filters
GuiRenderer.Begin(OutputSize.Width, OutputSize.Height);
GuiRenderer.SetBlendState(GL.BlendNone);
GuiRenderer.Modelview.Push();
GuiRenderer.Modelview.Translate(LL.vx, LL.vy);
GuiRenderer.Modelview.Scale(LL.WidthScale, LL.HeightScale);
//GuiRenderer.Modelview.Translate(LL.vx, LL.vy);
//GuiRenderer.Modelview.Scale(LL.WidthScale, LL.HeightScale);
if(FilterOption != eFilterOption.None)
InputTexture.SetFilterLinear();
else
@ -164,7 +164,7 @@ namespace BizHawk.Client.EmuHawk.Filters
}
GuiRenderer.Draw(InputTexture);
GuiRenderer.Draw(InputTexture,LL.vx,LL.vy,LL.vw,LL.vh);
GuiRenderer.End();
}

View File

@ -45,6 +45,7 @@
this.rbFinalFilterBicubic = new System.Windows.Forms.RadioButton();
this.rbFinalFilterNone = new System.Windows.Forms.RadioButton();
this.rbFinalFilterBilinear = new System.Windows.Forms.RadioButton();
this.checkObeyAR = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
this.groupBox2.SuspendLayout();
@ -54,7 +55,7 @@
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(289, 190);
this.btnCancel.Location = new System.Drawing.Point(289, 221);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 5;
@ -64,7 +65,7 @@
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.Location = new System.Drawing.Point(208, 190);
this.btnOk.Location = new System.Drawing.Point(208, 221);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 4;
@ -132,7 +133,7 @@
this.tbScanlineIntensity.Location = new System.Drawing.Point(83, 55);
this.tbScanlineIntensity.Maximum = 255;
this.tbScanlineIntensity.Name = "tbScanlineIntensity";
this.tbScanlineIntensity.Size = new System.Drawing.Size(70, 45);
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;
@ -183,7 +184,7 @@
// checkPadInteger
//
this.checkPadInteger.AutoSize = true;
this.checkPadInteger.Location = new System.Drawing.Point(12, 195);
this.checkPadInteger.Location = new System.Drawing.Point(12, 218);
this.checkPadInteger.Name = "checkPadInteger";
this.checkPadInteger.Size = new System.Drawing.Size(120, 17);
this.checkPadInteger.TabIndex = 9;
@ -235,13 +236,24 @@
this.rbFinalFilterBilinear.Text = "Bilinear";
this.rbFinalFilterBilinear.UseVisualStyleBackColor = true;
//
// checkObeyAR
//
this.checkObeyAR.AutoSize = true;
this.checkObeyAR.Location = new System.Drawing.Point(12, 195);
this.checkObeyAR.Name = "checkObeyAR";
this.checkObeyAR.Size = new System.Drawing.Size(211, 17);
this.checkObeyAR.TabIndex = 10;
this.checkObeyAR.Text = "Obey system\'s Aspect Ratio suggestion";
this.checkObeyAR.UseVisualStyleBackColor = true;
//
// DisplayConfigLite
//
this.AcceptButton = this.btnOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(376, 225);
this.ClientSize = new System.Drawing.Size(376, 256);
this.Controls.Add(this.checkObeyAR);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.checkPadInteger);
this.Controls.Add(this.checkLetterbox);
@ -282,5 +294,6 @@
private System.Windows.Forms.Button btnSelectUserFilter;
private System.Windows.Forms.RadioButton rbUser;
private System.Windows.Forms.Label lblUserFilterName;
private System.Windows.Forms.CheckBox checkObeyAR;
}
}

View File

@ -35,6 +35,7 @@ namespace BizHawk.Client.EmuHawk.config
tbScanlineIntensity.Value = Global.Config.TargetScanlineFilterIntensity;
checkLetterbox.Checked = Global.Config.DispFixAspectRatio;
checkPadInteger.Checked = Global.Config.DispFixScaleInteger;
checkObeyAR.Checked = Global.Config.DispObeyAR;
}
private void btnOk_Click(object sender, EventArgs e)
@ -58,6 +59,7 @@ namespace BizHawk.Client.EmuHawk.config
Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value;
Global.Config.DispFixAspectRatio = checkLetterbox.Checked;
Global.Config.DispFixScaleInteger = checkPadInteger.Checked;
Global.Config.DispObeyAR = checkObeyAR.Checked;
Global.Config.DispUserFilterPath = PathSelection;
GlobalWin.DisplayManager.RefreshUserShader();

View File

@ -249,6 +249,11 @@ namespace BizHawk.Bizware.BizwareGL
/// </summary>
public void DrawFlipped(Art art, bool xflip, bool yflip) { DrawInternal(art, 0, 0, art.Width, art.Height, xflip, yflip); }
public void Draw(Texture2d art, float x, float y, float width, float height)
{
DrawInternal(art, x, y, width, height);
}
unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h)
{
Art art = new Art(null);