/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: GDI Palette Functions
- * FILE: subsys/win32k/eng/palette.c
+ * FILE: subsystems/win32/win32k/objects/palette.c
* PROGRAMERS: Jason Filby
* Timo Kreuzer
*/
#define NDEBUG
#include <debug.h>
-static UINT SystemPaletteUse = SYSPAL_NOSTATIC; /* the program need save the pallete and restore it */
+static UINT SystemPaletteUse = SYSPAL_NOSTATIC; /* The program need save the pallete and restore it */
PALETTE gpalRGB, gpalBGR, gpalMono, gpalRGB555, gpalRGB565, *gppalDefault;
PPALETTE appalSurfaceDefault[11];
const PALETTEENTRY g_sysPalTemplate[NB_RESERVED_COLORS] =
{
- // first 10 entries in the system palette
- // red green blue flags
+ // First 10 entries in the system palette
+ // Red Green Blue Flags
{ 0x00, 0x00, 0x00, PC_SYS_USED },
{ 0x80, 0x00, 0x00, PC_SYS_USED },
{ 0x00, 0x80, 0x00, PC_SYS_USED },
{ 0x00, 0x00, 0xff, PC_SYS_USED },
{ 0xff, 0x00, 0xff, PC_SYS_USED },
{ 0x00, 0xff, 0xff, PC_SYS_USED },
- { 0xff, 0xff, 0xff, PC_SYS_USED } // last 10
+ { 0xff, 0xff, 0xff, PC_SYS_USED } // Last 10
};
unsigned short GetNumberOfBits(unsigned int dwMask)
HPALETTE hpalette;
PLOGPALETTE palPtr;
- // create default palette (20 system colors)
+ // Create default palette (20 system colors)
palPtr = ExAllocatePoolWithTag(PagedPool,
sizeof(LOGPALETTE) +
(NB_RESERVED_COLORS * sizeof(PALETTEENTRY)),
NTAPI
PALETTE_ulGetNearestIndex(PALETTE* ppal, ULONG ulColor)
{
- if (ppal->flFlags & PAL_INDEXED) // use fl & PALINDEXED
+ if (ppal->flFlags & PAL_INDEXED) // Use fl & PALINDEXED
return PALETTE_ulGetNearestPaletteIndex(ppal, ulColor);
else
return PALETTE_ulGetNearestBitFieldsIndex(ppal, ulColor);
}
else
{
- /* FIXME - Handle PalGDI == NULL!!!! */
+ /* FIXME: Handle PalGDI == NULL!!!! */
DPRINT1("PalGDI is NULL\n");
}
return NewPalette;
Palette.NumberOfEntries = 256;
if (IntGetSystemPaletteEntries(hDC, 0, 256, Palette.aEntries) == 0)
{
- /* from wine, more that 256 color math */
+ /* From WINE, more that 256 color math */
Palette.NumberOfEntries = 20;
for (i = 0; i < Palette.NumberOfEntries; i++)
{
Palette.aEntries[0].peBlue=0x00;
Palette.aEntries[0].peGreen=0x00;
- /* the first 6 */
+ /* The first 6 */
for (i=1; i <= 6; i++)
{
Palette.aEntries[i].peRed=(i%2)?0x80:0;
if(!(ppalSurf->flFlags & PAL_INDEXED))
{
- // FIXME : set error?
+ // FIXME: Set error?
goto cleanup;
}
ASSERT(ppalDC->flFlags & PAL_INDEXED);
- // FIXME : should we resize ppalSurf if it's too small?
+ // FIXME: Should we resize ppalSurf if it's too small?
realize = (ppalDC->NumColors < ppalSurf->NumColors) ? ppalDC->NumColors : ppalSurf->NumColors;
for(i=0; i<realize; i++)