import EGA palette fix from Wine

svn path=/trunk/; revision=74191
This commit is contained in:
Sebastian Gasiorek 2017-03-19 00:35:48 +00:00
parent a9d1e30a2a
commit 0c9274d5bf

View file

@ -11,27 +11,6 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
static const RGBQUAD EGAColorsQuads[16] =
{
/* rgbBlue, rgbGreen, rgbRed, rgbReserved */
{ 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x80, 0x00 },
{ 0x00, 0x80, 0x00, 0x00 },
{ 0x00, 0x80, 0x80, 0x00 },
{ 0x80, 0x00, 0x00, 0x00 },
{ 0x80, 0x00, 0x80, 0x00 },
{ 0x80, 0x80, 0x00, 0x00 },
{ 0x80, 0x80, 0x80, 0x00 },
{ 0xc0, 0xc0, 0xc0, 0x00 },
{ 0x00, 0x00, 0xff, 0x00 },
{ 0x00, 0xff, 0x00, 0x00 },
{ 0x00, 0xff, 0xff, 0x00 },
{ 0xff, 0x00, 0x00, 0x00 },
{ 0xff, 0x00, 0xff, 0x00 },
{ 0xff, 0xff, 0x00, 0x00 },
{ 0xff, 0xff, 0xff, 0x00 }
};
static const RGBQUAD DefLogPaletteQuads[20] = /* Copy of Default Logical Palette */ static const RGBQUAD DefLogPaletteQuads[20] = /* Copy of Default Logical Palette */
{ {
/* rgbBlue, rgbGreen, rgbRed, rgbReserved */ /* rgbBlue, rgbGreen, rgbRed, rgbReserved */
@ -883,7 +862,12 @@ GreGetDIBitsInternal(
break; break;
case 4: case 4:
RtlCopyMemory(rgbQuads, EGAColorsQuads, sizeof(EGAColorsQuads)); /* The EGA palette is the first and last 8 colours of the default palette
with the innermost pair swapped */
RtlCopyMemory(rgbQuads, DefLogPaletteQuads, 7 * sizeof(RGBQUAD));
RtlCopyMemory(rgbQuads + 7, DefLogPaletteQuads + 12, 1 * sizeof(RGBQUAD));
RtlCopyMemory(rgbQuads + 8, DefLogPaletteQuads + 7, 1 * sizeof(RGBQUAD));
RtlCopyMemory(rgbQuads + 9, DefLogPaletteQuads + 13, 7 * sizeof(RGBQUAD));
break; break;
case 8: case 8: