mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 21:44:31 +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 ******************************************************************/
|
/* 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
|
VOID
|
||||||
GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer)
|
GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer)
|
||||||
{
|
{
|
||||||
|
@ -217,8 +228,8 @@ GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
|
||||||
|
|
||||||
LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes;
|
LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes;
|
||||||
|
|
||||||
SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute)));
|
SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(LastAttribute)));
|
||||||
SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute)));
|
SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(LastAttribute)));
|
||||||
|
|
||||||
OldFont = SelectObject(GuiData->hMemDC, GuiData->Font);
|
OldFont = SelectObject(GuiData->hMemDC, GuiData->Font);
|
||||||
|
|
||||||
|
@ -247,8 +258,8 @@ GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
|
||||||
Attribute = From->Attributes;
|
Attribute = From->Attributes;
|
||||||
if (Attribute != LastAttribute)
|
if (Attribute != LastAttribute)
|
||||||
{
|
{
|
||||||
SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(Attribute)));
|
SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute)));
|
||||||
SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(Attribute)));
|
SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(Attribute)));
|
||||||
LastAttribute = Attribute;
|
LastAttribute = Attribute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -280,7 +291,7 @@ GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
|
||||||
Attribute = ConioCoordToPointer(Buffer, Buffer->CursorPosition.X, Buffer->CursorPosition.Y)->Attributes;
|
Attribute = ConioCoordToPointer(Buffer, Buffer->CursorPosition.X, Buffer->CursorPosition.Y)->Attributes;
|
||||||
if (Attribute == DEFAULT_SCREEN_ATTRIB) Attribute = Buffer->ScreenDefaultAttrib;
|
if (Attribute == DEFAULT_SCREEN_ATTRIB) Attribute = Buffer->ScreenDefaultAttrib;
|
||||||
|
|
||||||
CursorBrush = CreateSolidBrush(RGBFromAttrib(Console, Attribute));
|
CursorBrush = CreateSolidBrush(RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute)));
|
||||||
OldBrush = SelectObject(GuiData->hMemDC, CursorBrush);
|
OldBrush = SelectObject(GuiData->hMemDC, CursorBrush);
|
||||||
|
|
||||||
PatBlt(GuiData->hMemDC,
|
PatBlt(GuiData->hMemDC,
|
||||||
|
|
Loading…
Reference in a new issue