make intensity controllable

This commit is contained in:
zeromus 2013-12-03 01:37:49 +00:00
parent edba782f7c
commit 180043db0b
1 changed files with 7 additions and 6 deletions

View File

@ -33,6 +33,7 @@ namespace BizHawk.Client.EmuHawk
unsafe static void RunScanlines(byte* srcPtr, int srcPitch, byte* destPtr, int dstPitch, int width, int height)
{
const int intensity = (int)((0.75f) * 256);
byte* srcLine = srcPtr;
for (int y = 0; y < height; y++)
{
@ -56,13 +57,13 @@ namespace BizHawk.Client.EmuHawk
//second copied line (2x width, 25%)
for (int x = 0; x < width; x++)
{
*destPtr++ = (byte)((s[0]*3) >> 2);
*destPtr++ = (byte)((s[1]*3) >> 2);
*destPtr++ = (byte)((s[2]*3) >> 2);
*destPtr++ = (byte)((s[0] * intensity) >> 8);
*destPtr++ = (byte)((s[1] * intensity) >> 8);
*destPtr++ = (byte)((s[2] * intensity) >> 8);
*destPtr++ = s[3];
*destPtr++ = (byte)((s[0]*3) >> 2);
*destPtr++ = (byte)((s[1]*3) >> 2);
*destPtr++ = (byte)((s[2]*3) >> 2);
*destPtr++ = (byte)((s[0] * intensity) >> 8);
*destPtr++ = (byte)((s[1] * intensity) >> 8);
*destPtr++ = (byte)((s[2] * intensity) >> 8);
*destPtr++ = s[3];
s += 4;
}