mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-04-15 20:05:49 +02:00
Draw2 renamed to DrawWithoutCompose. Improved.
This commit is contained in:
parent
efaf94491e
commit
c355af81f4
@ -394,7 +394,7 @@ void XImage::GetArea(INTN x, INTN y, UINTN W, UINTN H)
|
||||
}
|
||||
}
|
||||
|
||||
void XImage::Draw2(INTN x, INTN y, UINTN width, UINTN height, float scale)
|
||||
void XImage::DrawWithoutCompose(INTN x, INTN y, UINTN width, UINTN height)
|
||||
{
|
||||
// //prepare images
|
||||
//// DBG("1\n");
|
||||
@ -406,8 +406,10 @@ void XImage::Draw2(INTN x, INTN y, UINTN width, UINTN height, float scale)
|
||||
//// DBG("4\n");
|
||||
// Background.Compose(0, 0, Top, true);
|
||||
//// DBG("5\n");
|
||||
UINTN AreaWidth = (x + Width > (UINTN)UGAWidth) ? (UGAWidth - x) : Width;
|
||||
UINTN AreaHeight = (y + Height > (UINTN)UGAHeight) ? (UGAHeight - y) : Height;
|
||||
if ( width == 0 ) width = Width;
|
||||
if ( height == 0 ) height = Height;
|
||||
UINTN AreaWidth = (x + width > (UINTN)UGAWidth) ? (UGAWidth - x) : width;
|
||||
UINTN AreaHeight = (y + height > (UINTN)UGAHeight) ? (UGAHeight - y) : height;
|
||||
// DBG("area=%d,%d\n", AreaWidth, AreaHeight);
|
||||
// prepare protocols
|
||||
EFI_STATUS Status;
|
||||
@ -427,11 +429,11 @@ void XImage::Draw2(INTN x, INTN y, UINTN width, UINTN height, float scale)
|
||||
if (GraphicsOutput != NULL) {
|
||||
GraphicsOutput->Blt(GraphicsOutput, (*this).GetPixelPtr(0, 0),
|
||||
EfiBltBufferToVideo,
|
||||
0, 0, x, y, width, height, GetWidth()*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||
0, 0, x, y, AreaWidth, AreaHeight, GetWidth()*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||
}
|
||||
else if (UgaDraw != NULL) {
|
||||
UgaDraw->Blt(UgaDraw, (EFI_UGA_PIXEL *)(*this).GetPixelPtr(0, 0), EfiUgaBltBufferToVideo,
|
||||
0, 0, x, y, AreaWidth, AreaHeight, 0);
|
||||
0, 0, x, y, AreaWidth, AreaHeight, GetWidth()*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ public:
|
||||
void GetArea(const EG_RECT& Rect);
|
||||
void GetArea(INTN x, INTN y, UINTN W, UINTN H);
|
||||
void Draw(INTN x, INTN y, float scale);
|
||||
void Draw2(INTN x, INTN y, UINTN width, UINTN height, float scale);
|
||||
void DrawWithoutCompose(INTN x, INTN y, UINTN width = 0, UINTN height = 0);
|
||||
};
|
||||
|
||||
#endif //__XSTRINGW_H__
|
||||
|
@ -40,7 +40,7 @@ XPointer::~XPointer()
|
||||
void XPointer::Hide()
|
||||
{
|
||||
if (Alive) {
|
||||
oldImage.Draw2(oldPlace.XPos, oldPlace.YPos, oldImage.GetWidth(), oldImage.GetHeight(), 1.f);
|
||||
oldImage.DrawWithoutCompose(oldPlace.XPos, oldPlace.YPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user