Author: khornicek
Date: Sun Oct 24 22:52:50 2010
New Revision: 49265
URL:
http://svn.reactos.org/svn/reactos?rev=49265&view=rev
Log:
[WIN32K]
Set proper flags and masks in BuildDIBPalette. Set PAL_BGR for 24/32 BPP in AllocPalette.
Rename Mode to Flags to better reflect its usage. Fixes "red icons" and
dibtest.
Modified:
branches/reactos-yarotows/subsystems/win32/win32k/eng/xlate.c
branches/reactos-yarotows/subsystems/win32/win32k/include/palette.h
branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/icm.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/palette.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/xlate.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/eng/xlate.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/eng/xlate.c [iso-8859-1] Sun Oct 24
22:52:50 2010
@@ -362,19 +362,19 @@
EXLATEOBJ_vInitTrivial(pexlo);
if (ppalDst == ppalSrc || !ppalSrc || !ppalDst ||
- ((ppalDst->Mode == PAL_RGB || ppalDst->Mode == PAL_BGR) &&
- ppalDst->Mode == ppalSrc->Mode))
+ ((ppalDst->flFlags == PAL_RGB || ppalDst->flFlags == PAL_BGR) &&
+ ppalDst->flFlags == ppalSrc->flFlags))
{
return;
}
pexlo->ppalSrc = ppalSrc;
pexlo->ppalDst = ppalDst;
- pexlo->xlo.iSrcType = ppalSrc->Mode;
- pexlo->xlo.iDstType = ppalDst->Mode;
+ pexlo->xlo.iSrcType = ppalSrc->flFlags;
+ pexlo->xlo.iDstType = ppalDst->flFlags;
/* Chack if both of the pallettes are indexed */
- if (!(ppalSrc->Mode & PAL_INDEXED) || !(ppalDst->Mode & PAL_INDEXED))
+ if (!(ppalSrc->flFlags & PAL_INDEXED) || !(ppalDst->flFlags &
PAL_INDEXED))
{
/* At least one palette is not indexed, calculate shifts/masks */
ULONG aulMasksSrc[3], aulMasksDst[3];
@@ -391,10 +391,10 @@
pexlo->ulBlueShift = CalculateShift(aulMasksSrc[2], aulMasksDst[2]);
}
- if (ppalSrc->Mode & PAL_MONOCHROME)
+ if (ppalSrc->flFlags & PAL_MONOCHROME)
{
/* This is a monochrome palette */
- if (!(ppalDst->Mode & PAL_MONOCHROME))
+ if (!(ppalDst->flFlags & PAL_MONOCHROME))
{
/* Mono to color, use the dest DC's fore and back color */
pexlo->pfnXlate = EXLATEOBJ_iXlateTable;
@@ -406,28 +406,28 @@
PALETTE_ulGetNearestIndex(ppalDst, crDstBackColor);
}
}
- else if (ppalDst->Mode & PAL_MONOCHROME)
+ else if (ppalDst->flFlags & PAL_MONOCHROME)
{
pexlo->pfnXlate = EXLATEOBJ_iXlateToMono;
pexlo->xlo.flXlate |= XO_TO_MONO;
pexlo->xlo.cEntries = 1;
- if (ppalSrc->Mode & PAL_INDEXED)
+ if (ppalSrc->flFlags & PAL_INDEXED)
{
pexlo->aulXlate[0] =
PALETTE_ulGetNearestPaletteIndex(ppalSrc, crSrcBackColor);
}
- else if (ppalSrc->Mode & PAL_BGR)
+ else if (ppalSrc->flFlags & PAL_BGR)
{
pexlo->aulXlate[0] = crSrcBackColor;
}
- else if (ppalSrc->Mode & PAL_RGB)
+ else if (ppalSrc->flFlags & PAL_RGB)
{
pexlo->aulXlate[0] = RGB(GetBValue(crSrcBackColor),
GetGValue(crSrcBackColor),
GetRValue(crSrcBackColor));
}
- else if (ppalSrc->Mode & PAL_BITFIELDS)
+ else if (ppalSrc->flFlags & PAL_BITFIELDS)
{
PALETTE_vGetBitMasks(ppalSrc, &pexlo->ulRedMask);
pexlo->ulRedShift = CalculateShift(0xFF, pexlo->ulRedMask);
@@ -437,7 +437,7 @@
pexlo->aulXlate[0] = EXLATEOBJ_iXlateShiftAndMask(pexlo, crSrcBackColor);
}
}
- else if (ppalSrc->Mode & PAL_INDEXED)
+ else if (ppalSrc->flFlags & PAL_INDEXED)
{
cEntries = ppalSrc->NumColors;
@@ -458,7 +458,7 @@
pexlo->xlo.cEntries = cEntries;
pexlo->pfnXlate = EXLATEOBJ_iXlateTable;
- if (ppalDst->Mode & PAL_INDEXED)
+ if (ppalDst->flFlags & PAL_INDEXED)
{
pexlo->xlo.flXlate |= XO_TABLE;
@@ -504,78 +504,78 @@
}
}
}
- else if (ppalSrc->Mode & PAL_RGB)
- {
- if (ppalDst->Mode & PAL_INDEXED)
+ else if (ppalSrc->flFlags & PAL_RGB)
+ {
+ if (ppalDst->flFlags & PAL_INDEXED)
pexlo->pfnXlate = EXLATEOBJ_iXlateRGBtoPal;
- else if (ppalDst->Mode & PAL_BGR)
+ else if (ppalDst->flFlags & PAL_BGR)
pexlo->pfnXlate = EXLATEOBJ_iXlateRGBtoBGR;
- else if (ppalDst->Mode & PAL_RGB16_555)
+ else if (ppalDst->flFlags & PAL_RGB16_555)
pexlo->pfnXlate = EXLATEOBJ_iXlateRGBto555;
- else if (ppalDst->Mode & PAL_RGB16_565)
+ else if (ppalDst->flFlags & PAL_RGB16_565)
pexlo->pfnXlate = EXLATEOBJ_iXlateRGBto565;
- else if (ppalDst->Mode & PAL_BITFIELDS)
+ else if (ppalDst->flFlags & PAL_BITFIELDS)
pexlo->pfnXlate = EXLATEOBJ_iXlateShiftAndMask;
}
- else if (ppalSrc->Mode & PAL_BGR)
- {
- if (ppalDst->Mode & PAL_INDEXED)
+ else if (ppalSrc->flFlags & PAL_BGR)
+ {
+ if (ppalDst->flFlags & PAL_INDEXED)
pexlo->pfnXlate = EXLATEOBJ_iXlateBitfieldsToPal;
- else if (ppalDst->Mode & PAL_RGB)
+ else if (ppalDst->flFlags & PAL_RGB)
/* The inverse function works the same */
pexlo->pfnXlate = EXLATEOBJ_iXlateRGBtoBGR;
- else if (ppalDst->Mode & PAL_RGB16_555)
+ else if (ppalDst->flFlags & PAL_RGB16_555)
pexlo->pfnXlate = EXLATEOBJ_iXlateBGRto555;
- else if (ppalDst->Mode & PAL_RGB16_565)
+ else if (ppalDst->flFlags & PAL_RGB16_565)
pexlo->pfnXlate = EXLATEOBJ_iXlateBGRto565;
- else if (ppalDst->Mode & PAL_BITFIELDS)
+ else if (ppalDst->flFlags & PAL_BITFIELDS)
pexlo->pfnXlate = EXLATEOBJ_iXlateShiftAndMask;
}
- else if (ppalSrc->Mode & PAL_RGB16_555)
- {
- if (ppalDst->Mode & PAL_INDEXED)
+ else if (ppalSrc->flFlags & PAL_RGB16_555)
+ {
+ if (ppalDst->flFlags & PAL_INDEXED)
pexlo->pfnXlate = EXLATEOBJ_iXlate555toPal;
- else if (ppalDst->Mode & PAL_RGB)
+ else if (ppalDst->flFlags & PAL_RGB)
pexlo->pfnXlate = EXLATEOBJ_iXlate555toRGB;
- else if (ppalDst->Mode & PAL_BGR)
+ else if (ppalDst->flFlags & PAL_BGR)
pexlo->pfnXlate = EXLATEOBJ_iXlate555toBGR;
- else if (ppalDst->Mode & PAL_RGB16_565)
+ else if (ppalDst->flFlags & PAL_RGB16_565)
pexlo->pfnXlate = EXLATEOBJ_iXlate555to565;
- else if (ppalDst->Mode & PAL_BITFIELDS)
+ else if (ppalDst->flFlags & PAL_BITFIELDS)
pexlo->pfnXlate = EXLATEOBJ_iXlateShiftAndMask;
}
- else if (ppalSrc->Mode & PAL_RGB16_565)
- {
- if (ppalDst->Mode & PAL_INDEXED)
+ else if (ppalSrc->flFlags & PAL_RGB16_565)
+ {
+ if (ppalDst->flFlags & PAL_INDEXED)
pexlo->pfnXlate = EXLATEOBJ_iXlate565toPal;
- else if (ppalDst->Mode & PAL_RGB)
+ else if (ppalDst->flFlags & PAL_RGB)
pexlo->pfnXlate = EXLATEOBJ_iXlate565toRGB;
- else if (ppalDst->Mode & PAL_BGR)
+ else if (ppalDst->flFlags & PAL_BGR)
pexlo->pfnXlate = EXLATEOBJ_iXlate565toBGR;
- else if (ppalDst->Mode & PAL_RGB16_555)
+ else if (ppalDst->flFlags & PAL_RGB16_555)
pexlo->pfnXlate = EXLATEOBJ_iXlate565to555;
- else if (ppalDst->Mode & PAL_BITFIELDS)
+ else if (ppalDst->flFlags & PAL_BITFIELDS)
pexlo->pfnXlate = EXLATEOBJ_iXlateShiftAndMask;
}
- else if (ppalSrc->Mode & PAL_BITFIELDS)
- {
- if (ppalDst->Mode & PAL_INDEXED)
+ else if (ppalSrc->flFlags & PAL_BITFIELDS)
+ {
+ if (ppalDst->flFlags & PAL_INDEXED)
pexlo->pfnXlate = EXLATEOBJ_iXlateBitfieldsToPal;
else
pexlo->pfnXlate = EXLATEOBJ_iXlateShiftAndMask;
@@ -694,9 +694,9 @@
/* Verify palette type match */
if (!ppal ||
((iPal == XO_SRCPALETTE || iPal == XO_DESTPALETTE)
- && !(ppal->Mode & PAL_INDEXED)) ||
+ && !(ppal->flFlags & PAL_INDEXED)) ||
((iPal == XO_SRCBITFIELDS || iPal == XO_DESTBITFIELDS)
- && !(ppal->Mode & PAL_BITFIELDS)))
+ && !(ppal->flFlags & PAL_BITFIELDS)))
{
return 0;
}
@@ -707,7 +707,7 @@
}
/* Copy the values into the buffer */
- if (ppal->Mode & PAL_INDEXED)
+ if (ppal->flFlags & PAL_INDEXED)
{
cPal = min(cPal, ppal->NumColors);
for (i = 0; i < cPal; i++)
Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/palette.h
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/include/palette.h [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/include/palette.h [iso-8859-1] Sun
Oct 24 22:52:50 2010
@@ -40,7 +40,7 @@
PALOBJ PalObj;
XLATEOBJ *logicalToSystem;
HPALETTE Self;
- ULONG Mode; // PAL_INDEXED, PAL_BITFIELDS, PAL_RGB, PAL_BGR
+ FLONG flFlags; // PAL_INDEXED, PAL_BITFIELDS, PAL_RGB, PAL_BGR
ULONG NumColors;
PALETTEENTRY *IndexedColors;
ULONG RedMask;
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Sun
Oct 24 22:52:50 2010
@@ -949,7 +949,7 @@
pds->dsBmih.biHeight = pds->dsBm.bmHeight;
pds->dsBmih.biPlanes = pds->dsBm.bmPlanes;
pds->dsBmih.biBitCount = pds->dsBm.bmBitsPixel;
- if(psurf->ppal->Mode & PAL_BITFIELDS)
+ if(psurf->ppal->flFlags & PAL_BITFIELDS)
{
pds->dsBmih.biCompression = BI_BITFIELDS;
}
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Sun
Oct 24 22:52:50 2010
@@ -166,7 +166,7 @@
/* Is this a valid palette for this depth? */
if ((BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) <= 8
- && ppal->Mode == PAL_INDEXED) ||
+ && (ppal->flFlags & PAL_INDEXED)) ||
(BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) > 8))
{
/* Get old palette, set new one */
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Sun
Oct 24 22:52:50 2010
@@ -1690,7 +1690,7 @@
USHORT *lpIndex;
HPALETTE hpal;
- if (ppal->Mode != PAL_INDEXED)
+ if (!(ppal->flFlags & PAL_INDEXED))
{
return NULL;
}
@@ -1764,17 +1764,33 @@
GreenMask = pdwColors[1];
BlueMask = pdwColors[2];
}
- else if (bits == 15)
- {
- paletteType = PAL_RGB16_555;
- }
- else if (bits == 16)
- {
- paletteType = PAL_RGB16_565;
- }
else
{
- paletteType = PAL_BGR;
+ paletteType = PAL_BITFIELDS;
+ switch (bits)
+ {
+ case 15:
+ paletteType |= PAL_RGB16_555;
+ RedMask = 0x7C00;
+ GreenMask = 0x03E0;
+ BlueMask = 0x001F;
+ break;
+
+ case 16:
+ paletteType |= PAL_RGB16_565;
+ RedMask = 0xF800;
+ GreenMask = 0x07E0;
+ BlueMask = 0x001F;
+ break;
+
+ case 24:
+ case 32:
+ paletteType |= PAL_BGR;
+ RedMask = 0xFF0000;
+ GreenMask = 0x00FF00;
+ BlueMask = 0x0000FF;
+ break;
+ }
}
if (bmi->bmiHeader.biClrUsed == 0)
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/icm.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/icm.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/icm.c [iso-8859-1] Sun Oct
24 22:52:50 2010
@@ -256,9 +256,9 @@
palPtr = (PALOBJ*) palGDI;
if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE)
- palGDI->Mode |= PAL_GAMMACORRECTION;
+ palGDI->flFlags |= PAL_GAMMACORRECTION;
else
- palGDI->Mode &= ~PAL_GAMMACORRECTION;
+ palGDI->flFlags &= ~PAL_GAMMACORRECTION;
if (!(pGDev->flFlags & PDEV_DRIVER_PUNTED_CALL)) // No punting, we hook
{
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/palette.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/palette.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/palette.c [iso-8859-1] Sun
Oct 24 22:52:50 2010
@@ -85,28 +85,28 @@
/* palette_size = visual->map_entries; */
- gpalRGB.Mode = PAL_RGB;
+ gpalRGB.flFlags = PAL_RGB;
gpalRGB.RedMask = RGB(0xFF, 0x00, 0x00);
gpalRGB.GreenMask = RGB(0x00, 0xFF, 0x00);
gpalRGB.BlueMask = RGB(0x00, 0x00, 0xFF);
gpalRGB.BaseObject.ulShareCount = 0;
gpalRGB.BaseObject.BaseFlags = 0 ;
- gpalBGR.Mode = PAL_BGR;
+ gpalBGR.flFlags = PAL_BGR;
gpalBGR.RedMask = RGB(0x00, 0x00, 0xFF);
gpalBGR.GreenMask = RGB(0x00, 0xFF, 0x00);
gpalBGR.BlueMask = RGB(0xFF, 0x00, 0x00);
gpalBGR.BaseObject.ulShareCount = 0;
gpalBGR.BaseObject.BaseFlags = 0 ;
- gpalRGB555.Mode = PAL_RGB16_555 | PAL_BITFIELDS;
+ gpalRGB555.flFlags = PAL_RGB16_555 | PAL_BITFIELDS;
gpalRGB555.RedMask = 0x7C00;
gpalRGB555.GreenMask = 0x3E0;
gpalRGB555.BlueMask = 0x1F;
gpalRGB555.BaseObject.ulShareCount = 0;
gpalRGB555.BaseObject.BaseFlags = 0 ;
- gpalRGB565.Mode = PAL_RGB16_565 | PAL_BITFIELDS;
+ gpalRGB565.flFlags = PAL_RGB16_565 | PAL_BITFIELDS;
gpalRGB565.RedMask = 0xF800;
gpalRGB565.GreenMask = 0x7E0;
gpalRGB565.BlueMask = 0x1F;
@@ -114,7 +114,7 @@
gpalRGB565.BaseObject.BaseFlags = 0 ;
memset(&gpalMono, 0, sizeof(PALETTE));
- gpalMono.Mode = PAL_MONOCHROME;
+ gpalMono.flFlags = PAL_MONOCHROME;
gpalMono.BaseObject.ulShareCount = 0;
gpalMono.BaseObject.BaseFlags = 0 ;
@@ -162,7 +162,7 @@
NewPalette = PalGDI->BaseObject.hHmgr;
PalGDI->Self = NewPalette;
- PalGDI->Mode = Mode;
+ PalGDI->flFlags = Mode;
if (NULL != Colors)
{
@@ -178,20 +178,22 @@
RtlCopyMemory(PalGDI->IndexedColors, Colors, sizeof(PALETTEENTRY) *
NumColors);
}
- if (PAL_INDEXED == Mode)
+ if (Mode & PAL_INDEXED)
{
PalGDI->NumColors = NumColors;
}
- else if (PAL_BITFIELDS == Mode)
+ else if (Mode & PAL_BITFIELDS)
{
PalGDI->RedMask = Red;
PalGDI->GreenMask = Green;
PalGDI->BlueMask = Blue;
if (Red == 0x7c00 && Green == 0x3E0 && Blue == 0x1F)
- PalGDI->Mode |= PAL_RGB16_555;
+ PalGDI->flFlags |= PAL_RGB16_555;
else if (Red == 0xF800 && Green == 0x7E0 && Blue == 0x1F)
- PalGDI->Mode |= PAL_RGB16_565;
+ PalGDI->flFlags |= PAL_RGB16_565;
+ else if (Red == 0xFF0000 && Green == 0xFF00 && Blue == 0xFF)
+ PalGDI->flFlags |= PAL_BGR;
}
PALETTE_UnlockPalette(PalGDI);
@@ -217,7 +219,7 @@
NewPalette = PalGDI->BaseObject.hHmgr;
PalGDI->Self = NewPalette;
- PalGDI->Mode = PAL_INDEXED;
+ PalGDI->flFlags = PAL_INDEXED;
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool,
sizeof(PALETTEENTRY) * NumColors,
@@ -321,7 +323,7 @@
NTAPI
PALETTE_ulGetNearestIndex(PALETTE* ppal, ULONG ulColor)
{
- if (ppal->Mode & PAL_INDEXED) // use fl & PALINDEXED
+ if (ppal->flFlags & PAL_INDEXED) // use fl & PALINDEXED
return PALETTE_ulGetNearestPaletteIndex(ppal, ulColor);
else
return PALETTE_ulGetNearestBitFieldsIndex(ppal, ulColor);
@@ -333,19 +335,19 @@
{
ASSERT(pulColors);
- if (ppal->Mode & PAL_INDEXED || ppal->Mode & PAL_RGB)
+ if (ppal->flFlags & PAL_INDEXED || ppal->flFlags & PAL_RGB)
{
pulColors[0] = RGB(0xFF, 0x00, 0x00);
pulColors[1] = RGB(0x00, 0xFF, 0x00);
pulColors[2] = RGB(0x00, 0x00, 0xFF);
}
- else if (ppal->Mode & PAL_BGR)
+ else if (ppal->flFlags & PAL_BGR)
{
pulColors[0] = RGB(0x00, 0x00, 0xFF);
pulColors[1] = RGB(0x00, 0xFF, 0x00);
pulColors[2] = RGB(0xFF, 0x00, 0x00);
}
- else if (ppal->Mode & PAL_BITFIELDS)
+ else if (ppal->flFlags & PAL_BITFIELDS)
{
pulColors[0] = ppal->RedMask;
pulColors[1] = ppal->GreenMask;
@@ -433,7 +435,7 @@
/* NOTE: PaletteEntry ULONGs are in the same order as PALETTEENTRY. */
RtlCopyMemory(PaletteEntry, PalGDI->IndexedColors + Start, sizeof(ULONG) *
Colors);
- if (PalGDI->Mode & PAL_GAMMACORRECTION)
+ if (PalGDI->flFlags & PAL_GAMMACORRECTION)
ColorCorrection(PalGDI, (PPALETTEENTRY)PaletteEntry, Colors);
return Colors;
@@ -664,17 +666,17 @@
return nearest;
}
- if (palGDI->Mode & PAL_INDEXED)
+ if (palGDI->flFlags & PAL_INDEXED)
{
ULONG index;
index = PALETTE_ulGetNearestPaletteIndex(palGDI, Color);
nearest = PALETTE_ulGetRGBColorFromIndex(palGDI, index);
}
- else if (palGDI->Mode & PAL_RGB || palGDI->Mode & PAL_BGR)
+ else if (palGDI->flFlags & PAL_RGB || palGDI->flFlags & PAL_BGR)
{
nearest = Color;
}
- else if (palGDI->Mode & PAL_BITFIELDS)
+ else if (palGDI->flFlags & PAL_BITFIELDS)
{
RBits = 8 - GetNumberOfBits(palGDI->RedMask);
GBits = 8 - GetNumberOfBits(palGDI->GreenMask);
@@ -702,7 +704,7 @@
if (ppal)
{
- if (ppal->Mode & PAL_INDEXED)
+ if (ppal->flFlags & PAL_INDEXED)
{
/* Return closest match for the given RGB color */
index = PALETTE_ulGetNearestPaletteIndex(ppal, crColor);