Swicth Cursor to UINTN to conform renderSVGtext.

This commit is contained in:
jief 2020-04-16 00:04:33 +03:00
parent 6e1f5206b8
commit 71562cf66a
5 changed files with 11 additions and 11 deletions

View File

@ -1403,7 +1403,7 @@ VOID REFIT_MENU_SCREEN::DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN
}
VOID REFIT_MENU_SCREEN::DrawMenuText(IN XStringW& Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN INTN Cursor)
VOID REFIT_MENU_SCREEN::DrawMenuText(IN XStringW& Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN UINTN Cursor)
{
XImage TextBufferX(UGAWidth-XPos, ThemeX.TextHeight);
XImage SelectionBar(UGAWidth-XPos, ThemeX.TextHeight);

View File

@ -218,7 +218,7 @@ public:
INTN DrawTextXY(IN CONST XStringW& Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
void EraseTextXY();
VOID DrawTextCorner(UINTN TextC, UINT8 Align);
VOID DrawMenuText(IN XStringW& Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN INTN Cursor);
VOID DrawMenuText(IN XStringW& Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN UINTN Cursor);
VOID DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
VOID CountItems();
VOID InitAnime();

View File

@ -417,12 +417,12 @@ INTN renderSVGtext(XImage* TextBufferXY_ptr, INTN posX, INTN posY, INTN textType
{
XImage& TextBufferXY = *TextBufferXY_ptr;
INTN Width;
UINTN i;
// UINTN i;
UINTN len;
NSVGparser* p;
NSVGrasterizer* rast;
if (!textFace[textType].valid) {
for (i=0; i<4; i++) {
for (decltype(textType) i=0; i<4; i++) {
if (textFace[i].valid) {
textType = i;
break;
@ -472,7 +472,7 @@ INTN renderSVGtext(XImage* TextBufferXY_ptr, INTN posX, INTN posY, INTN textType
x = (float)posX; //0.f;
y = (float)posY + fontSVG->bbox[1] * Scale;
p->isText = TRUE;
for (i=0; i < len; i++) {
for (UINTN i=0; i < len; i++) {
CHAR16 letter = string.wc_str()[i];
if (!letter) {
break;

View File

@ -137,10 +137,10 @@ public:
void PrepareFont();
INTN GetEmpty(const XImage& Buffer, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& FirstPixel, INTN Start, INTN Step);
INTN RenderText(IN const XStringW& Text, OUT XImage* CompImage_ptr,
IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType, float textScale = 0.f);
IN INTN PosX, IN INTN PosY, IN UINTN Cursor, INTN textType, float textScale = 0.f);
//overload for UTF8 text
INTN RenderText(IN const XString& Text, OUT XImage* CompImage_ptr,
IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType, float textScale = 0.f);
IN INTN PosX, IN INTN PosY, IN UINTN Cursor, INTN textType, float textScale = 0.f);
VOID MeasureText(IN const XStringW& Text, OUT INTN *Width, OUT INTN *Height);

View File

@ -248,20 +248,20 @@ INTN XTheme::GetEmpty(const XImage& Buffer, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL&
}
INTN XTheme::RenderText(IN const XString& Text, OUT XImage* CompImage_ptr,
IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType, float textScale)
IN INTN PosX, IN INTN PosY, IN UINTN Cursor, INTN textType, float textScale)
{
const XStringW& UTF16Text = XStringW().takeValueFrom(Text.c_str());
return RenderText(UTF16Text, CompImage_ptr, PosX, PosY, Cursor, textType, textScale);
}
INTN XTheme::RenderText(IN const XStringW& Text, OUT XImage* CompImage_ptr,
IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType, float textScale)
IN INTN PosX, IN INTN PosY, IN UINTN Cursor, INTN textType, float textScale)
{
XImage& CompImage = *CompImage_ptr;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL FontPixel;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL FirstPixel;
INTN TextLength;
UINTN TextLength;
UINTN Cho = 0, Jong = 0, Joong = 0;
INTN LeftSpace, RightSpace;
@ -301,7 +301,7 @@ INTN XTheme::RenderText(IN const XStringW& Text, OUT XImage* CompImage_ptr,
Bukva.Width = FontWidth;
Bukva.Height = FontHeight;
DBG("codepage=%llx, asciiPage=%x\n", GlobalConfig.Codepage, AsciiPageSize);
for (INTN i = 0; i < TextLength && c0 != 0; i++) {
for (UINTN i = 0; i < TextLength && c0 != 0; i++) {
UINT16 c = Text.wc_str()[i]; //including UTF8 -> UTF16 conversion
DBG("initial char to render 0x%x\n", c); //good
if (gLanguage != korean) { //russian Codepage = 0x410