run filter intensity through Global.Config.TargetScanlineFilterIntensity

This commit is contained in:
zeromus 2013-12-03 01:52:36 +00:00
parent 56897e70a3
commit a2b3201912
2 changed files with 5 additions and 2 deletions

View File

@ -59,6 +59,7 @@ namespace BizHawk.Client.Common
public bool StackOSDMessages = true; public bool StackOSDMessages = true;
public int TargetZoomFactor = 2; public int TargetZoomFactor = 2;
public int TargetDisplayFilter = 0; public int TargetDisplayFilter = 0;
public int TargetScanlineFilterIntensity = 0; //choose between 0 and 256
public RecentFiles RecentRoms = new RecentFiles(8); public RecentFiles RecentRoms = new RecentFiles(8);
public bool PauseWhenMenuActivated = true; public bool PauseWhenMenuActivated = true;
public bool SaveWindowPosition = true; public bool SaveWindowPosition = true;

View File

@ -6,6 +6,7 @@ using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using BizHawk.Client.Common;
//what license is this?? who knows?? //what license is this?? who knows??
//ref: http://vba-rerecording.googlecode.com/svn/trunk/src/2xsai.cpp //ref: http://vba-rerecording.googlecode.com/svn/trunk/src/2xsai.cpp
@ -33,7 +34,8 @@ namespace BizHawk.Client.EmuHawk
unsafe static void RunScanlines(byte* srcPtr, int srcPitch, byte* destPtr, int dstPitch, int width, int height) unsafe static void RunScanlines(byte* srcPtr, int srcPitch, byte* destPtr, int dstPitch, int width, int height)
{ {
const int intensity = (int)((0.75f) * 256); int intensity = Global.Config.TargetScanlineFilterIntensity;
byte* srcLine = srcPtr; byte* srcLine = srcPtr;
for (int y = 0; y < height; y++) for (int y = 0; y < height; y++)
{ {
@ -54,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
destPtr += dstPitch - width*2 * 4; destPtr += dstPitch - width*2 * 4;
s = srcLine; s = srcLine;
//second copied line (2x width, 25%) //second copied line (2x width, dimmed)
for (int x = 0; x < width; x++) for (int x = 0; x < width; x++)
{ {
*destPtr++ = (byte)((s[0] * intensity) >> 8); *destPtr++ = (byte)((s[0] * intensity) >> 8);