mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Better palette generating algorithm.
svn path=/trunk/; revision=7614
This commit is contained in:
parent
1057df8763
commit
109bff5226
1 changed files with 4 additions and 10 deletions
|
@ -63,7 +63,6 @@ IntInitDefaultPalette(
|
|||
{
|
||||
ULONG ColorLoop;
|
||||
PPALETTEENTRY PaletteEntryPtr;
|
||||
BYTE Red = 0, Green = 0, Blue = 0;
|
||||
|
||||
if (ppdev->BitsPerPixel > 8)
|
||||
{
|
||||
|
@ -73,8 +72,7 @@ IntInitDefaultPalette(
|
|||
}
|
||||
else
|
||||
{
|
||||
ppdev->PaletteEntries = EngAllocMem(FL_ZERO_MEMORY,
|
||||
sizeof(PALETTEENTRY) << 8, ALLOC_TAG);
|
||||
ppdev->PaletteEntries = EngAllocMem(0, sizeof(PALETTEENTRY) << 8, ALLOC_TAG);
|
||||
if (ppdev->PaletteEntries == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -84,14 +82,10 @@ IntInitDefaultPalette(
|
|||
ColorLoop != 0;
|
||||
ColorLoop--, PaletteEntryPtr++)
|
||||
{
|
||||
PaletteEntryPtr->peRed = Red;
|
||||
PaletteEntryPtr->peGreen = Green;
|
||||
PaletteEntryPtr->peBlue = Blue;
|
||||
PaletteEntryPtr->peRed = ((ColorLoop >> 5) & 7) * 255 / 7;
|
||||
PaletteEntryPtr->peGreen = ((ColorLoop >> 3) & 3) * 255 / 3;
|
||||
PaletteEntryPtr->peBlue = (ColorLoop & 7) * 255 / 7;
|
||||
PaletteEntryPtr->peFlags = 0;
|
||||
|
||||
if (!(Red += 32))
|
||||
if (!(Green += 32))
|
||||
Blue += 64;
|
||||
}
|
||||
|
||||
memcpy(ppdev->PaletteEntries, BASEPALETTE, 10 * sizeof(PALETTEENTRY));
|
||||
|
|
Loading…
Reference in a new issue