fix gif palette rgb ordering. separate commit because the bitfield fiddling is a bit mysterious and required guessing. also forgot to commit csproj

This commit is contained in:
zeromus 2016-04-10 03:00:08 -05:00
parent d39dc2296e
commit 8e92371178
3 changed files with 18 additions and 9 deletions

View File

@ -381,9 +381,9 @@ namespace BizHawk.Client.EmuHawk
{
// Go to the next level down in the tree
int shift = 7 - level;
int r = pixel & 0xFF;
int b = pixel & 0xFF;
int g = (pixel >> 8) & 0xFF;
int b = (pixel >> 16) & 0xFF;
int r = (pixel >> 16) & 0xFF;
int index = ((r & mask[level]) >> (shift - 2)) |
((g & mask[level]) >> (shift - 1)) |
((b & mask[level]) >> (shift));
@ -504,9 +504,9 @@ namespace BizHawk.Client.EmuHawk
if (!_leaf)
{
int shift = 7 - level;
int r = pixel & 0xFF;
int b = pixel & 0xFF;
int g = (pixel >> 8) & 0xFF;
int b = (pixel >> 16) & 0xFF;
int r = (pixel >> 16) & 0xFF;
int index = ((r & mask[level]) >> (shift - 2)) |
((g & mask[level]) >> (shift - 1)) |
((b & mask[level]) >> (shift));
@ -530,9 +530,9 @@ namespace BizHawk.Client.EmuHawk
public void Increment(int pixel)
{
++_pixelCount;
int r = pixel&0xFF;
int b = pixel&0xFF;
int g = (pixel>>8) & 0xFF;
int b = (pixel >> 16) & 0xFF;
int r = (pixel >> 16) & 0xFF;
_red += r;
_green += g;
_blue += b;

View File

@ -249,9 +249,9 @@ namespace BizHawk.Client.EmuHawk
// Quantize the pixel
int srcPixel = *pSourcePixel;
int srcR = srcPixel & 0xFF;
int srcG = (srcPixel>>8) & 0xFF;
int srcB = (srcPixel>>16) & 0xFF;
int srcR = srcPixel & 0xFF; //not
int srcG = (srcPixel>>8) & 0xFF; //a
int srcB = (srcPixel>>16) & 0xFF; //mistake
int srcA = (srcPixel >> 24) & 0xFF;
int targetB = ClampToByte(srcB - ((errorThisRowB[col] * weight) / 8));

View File

@ -197,6 +197,15 @@
<Compile Include="AVOut\NutMuxer.cs" />
<Compile Include="AVOut\NutWriter.cs" />
<Compile Include="AVOut\ImageSequenceWriter.cs" />
<Compile Include="AVOut\Quantize\OctreeQuantizer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AVOut\Quantize\PaletteTable.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AVOut\Quantize\Quantizer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AVOut\SynclessRecorder.cs" />
<Compile Include="AVOut\SynclessRecordingTools.cs">
<SubType>Form</SubType>