mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[CONSRV]: Make changing the console palette for text buffers working properly (needed for NTVDM).
svn path=/trunk/; revision=60885
This commit is contained in:
parent
9da54eeefb
commit
6800c4f9e2
|
@ -22,6 +22,17 @@
|
|||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
COLORREF RGBFromAttrib2(PCONSOLE Console, WORD Attribute)
|
||||
{
|
||||
HPALETTE hPalette = Console->ActiveBuffer->PaletteHandle;
|
||||
PALETTEENTRY pe;
|
||||
|
||||
if (hPalette == NULL) return RGBFromAttrib(Console, Attribute);
|
||||
|
||||
GetPaletteEntries(hPalette, Attribute, 1, &pe);
|
||||
return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue);
|
||||
}
|
||||
|
||||
VOID
|
||||
GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer)
|
||||
{
|
||||
|
@ -217,8 +228,8 @@ GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
|
|||
|
||||
LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes;
|
||||
|
||||
SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute)));
|
||||
SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute)));
|
||||
SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(LastAttribute)));
|
||||
SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(LastAttribute)));
|
||||
|
||||
OldFont = SelectObject(GuiData->hMemDC, GuiData->Font);
|
||||
|
||||
|
@ -247,8 +258,8 @@ GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
|
|||
Attribute = From->Attributes;
|
||||
if (Attribute != LastAttribute)
|
||||
{
|
||||
SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(Attribute)));
|
||||
SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(Attribute)));
|
||||
SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute)));
|
||||
SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(Attribute)));
|
||||
LastAttribute = Attribute;
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +291,7 @@ GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
|
|||
Attribute = ConioCoordToPointer(Buffer, Buffer->CursorPosition.X, Buffer->CursorPosition.Y)->Attributes;
|
||||
if (Attribute == DEFAULT_SCREEN_ATTRIB) Attribute = Buffer->ScreenDefaultAttrib;
|
||||
|
||||
CursorBrush = CreateSolidBrush(RGBFromAttrib(Console, Attribute));
|
||||
CursorBrush = CreateSolidBrush(RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute)));
|
||||
OldBrush = SelectObject(GuiData->hMemDC, CursorBrush);
|
||||
|
||||
PatBlt(GuiData->hMemDC,
|
||||
|
|
Loading…
Reference in a new issue