mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 09:21:23 +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;
|
ULONG ColorLoop;
|
||||||
PPALETTEENTRY PaletteEntryPtr;
|
PPALETTEENTRY PaletteEntryPtr;
|
||||||
BYTE Red = 0, Green = 0, Blue = 0;
|
|
||||||
|
|
||||||
if (ppdev->BitsPerPixel > 8)
|
if (ppdev->BitsPerPixel > 8)
|
||||||
{
|
{
|
||||||
|
@ -73,8 +72,7 @@ IntInitDefaultPalette(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ppdev->PaletteEntries = EngAllocMem(FL_ZERO_MEMORY,
|
ppdev->PaletteEntries = EngAllocMem(0, sizeof(PALETTEENTRY) << 8, ALLOC_TAG);
|
||||||
sizeof(PALETTEENTRY) << 8, ALLOC_TAG);
|
|
||||||
if (ppdev->PaletteEntries == NULL)
|
if (ppdev->PaletteEntries == NULL)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -84,14 +82,10 @@ IntInitDefaultPalette(
|
||||||
ColorLoop != 0;
|
ColorLoop != 0;
|
||||||
ColorLoop--, PaletteEntryPtr++)
|
ColorLoop--, PaletteEntryPtr++)
|
||||||
{
|
{
|
||||||
PaletteEntryPtr->peRed = Red;
|
PaletteEntryPtr->peRed = ((ColorLoop >> 5) & 7) * 255 / 7;
|
||||||
PaletteEntryPtr->peGreen = Green;
|
PaletteEntryPtr->peGreen = ((ColorLoop >> 3) & 3) * 255 / 3;
|
||||||
PaletteEntryPtr->peBlue = Blue;
|
PaletteEntryPtr->peBlue = (ColorLoop & 7) * 255 / 7;
|
||||||
PaletteEntryPtr->peFlags = 0;
|
PaletteEntryPtr->peFlags = 0;
|
||||||
|
|
||||||
if (!(Red += 32))
|
|
||||||
if (!(Green += 32))
|
|
||||||
Blue += 64;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(ppdev->PaletteEntries, BASEPALETTE, 10 * sizeof(PALETTEENTRY));
|
memcpy(ppdev->PaletteEntries, BASEPALETTE, 10 * sizeof(PALETTEENTRY));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue