fix underscore bug and remove old workarounds

This commit is contained in:
ardi@ist-einmalig.de 2009-05-21 23:12:00 +00:00
parent fa573e22e3
commit 93aadca881
6 changed files with 13 additions and 50 deletions

View File

@ -625,7 +625,7 @@ uint16_t FreeTypeGX::getHeight(wchar_t const *text) {
*/ */
ftgxDataOffset FreeTypeGX::getOffset(wchar_t *text) { ftgxDataOffset FreeTypeGX::getOffset(wchar_t *text) {
uint16_t strLength = wcslen(text); uint16_t strLength = wcslen(text);
uint16_t strMax = 0, strMin = 0; int16_t strMax = 0, strMin = 0;
for (uint16_t i = 0; i < strLength; i++) { for (uint16_t i = 0; i < strLength; i++) {

View File

@ -173,8 +173,8 @@ typedef struct ftgxCharData_ {
uint16_t textureHeight; /**< Texture glyph height in pixels/bytes. */ uint16_t textureHeight; /**< Texture glyph height in pixels/bytes. */
uint16_t renderOffsetY; /**< Texture Y axis bearing offset. */ uint16_t renderOffsetY; /**< Texture Y axis bearing offset. */
uint16_t renderOffsetMax; /**< Texture Y axis bearing maximum value. */ int16_t renderOffsetMax; /**< Texture Y axis bearing maximum value. */
uint16_t renderOffsetMin; /**< Texture Y axis bearing minimum value. */ int16_t renderOffsetMin; /**< Texture Y axis bearing minimum value. */
uint32_t* glyphDataTexture; /**< Glyph texture bitmap data buffer. */ uint32_t* glyphDataTexture; /**< Glyph texture bitmap data buffer. */
} ftgxCharData; } ftgxCharData;

View File

@ -342,12 +342,7 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
optionTxt[i]->SetText(options->name[next]); optionTxt[i]->SetText(options->name[next]);
optionVal[i]->SetText(options->value[next]); optionVal[i]->SetText(options->value[next]);
char* pch; optionVal[i]->SetPosition(coL2, 0);
pch=strrchr((options->value[next]),'_');
if (pch!=NULL){optionVal[i]->SetPosition(coL2, 15);}
else {optionVal[i]->SetPosition(coL2, 0);}
optionIndex[i] = next; optionIndex[i] = next;
next = this->FindMenuItem(next, 1); next = this->FindMenuItem(next, 1);

View File

@ -144,12 +144,6 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
gameTxt[i] = new GuiText(buffer, 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff}); gameTxt[i] = new GuiText(buffer, 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff});
gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxt[i]->SetPosition(24,0); gameTxt[i]->SetPosition(24,0);
char* pch;
pch=strrchr((buffer),'_');
if (pch!=NULL){gameTxt[i]->SetPosition(24, 15);}
else {gameTxt[i]->SetPosition(24, 0);}
gameBg[i] = new GuiImage(bgGamesEntry); gameBg[i] = new GuiImage(bgGamesEntry);
@ -366,12 +360,8 @@ void GuiGameBrowser::Update(GuiTrigger * t)
} }
gameTxt[i]->SetText(buffer); gameTxt[i]->SetText(buffer);
char* pch; gameTxt[i]->SetPosition(24, 0);
pch=strrchr((buffer),'_');
if (pch!=NULL){gameTxt[i]->SetPosition(24, 15);}
else {gameTxt[i]->SetPosition(24, 0);}
gameIndex[i] = next; gameIndex[i] = next;
next = this->FindMenuItem(next, 1); next = this->FindMenuItem(next, 1);
} }

View File

@ -202,8 +202,8 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang)
{'v','V','©','Ï'}, {'v','V','©','Ï'},
{'b','B','\0','ï'}, {'b','B','\0','ï'},
{'n','N','\0','Õ'}, {'n','N','\0','Õ'},
{'m','M','\0','õ'}, {'m','M','µ','õ'},
{',',';','µ','ÿ'}, {',',';','\0','ÿ'},
{'.',':','\0','\0'}, {'.',':','\0','\0'},
{'-','_','\0','\0'} {'-','_','\0','\0'}
} }
@ -538,12 +538,8 @@ void GuiKeyboard::Update(GuiTrigger * t)
} }
} }
} }
char* pch;
pch=strrchr(kbtextstr,'_'); kbText->SetPosition(0, 53);
if (pch!=NULL){kbText->SetPosition(0, 68);}
else {kbText->SetPosition(0, 53);}
this->ToggleFocus(t); this->ToggleFocus(t);

View File

@ -288,22 +288,11 @@ static void WindowCredits(void * ptr)
txt[i] = new GuiText(LANGUAGE.For); txt[i] = new GuiText(LANGUAGE.For);
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(-80,y); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(-80,y);
char* pch; txt[i]->SetPosition(-80, y);
char* pch2;
pch=strrchr((LANGUAGE.For),'_');
pch2=strrchr((LANGUAGE.For),'p');
if ((pch!=NULL)||(pch2!=NULL)){txt[i]->SetPosition(-80, y+5);}
else {txt[i]->SetPosition(-80, y);}
i++; i++;
txt[i] = new GuiText(LANGUAGE.For); txt[i] = new GuiText(LANGUAGE.For);
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(130,y); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(130,y);
pch=strrchr((LANGUAGE.For),'_'); txt[i]->SetPosition(130, y);
pch2=strrchr((LANGUAGE.For),'p');
if ((pch!=NULL)||(pch2!=NULL)){txt[i]->SetPosition(130, y+5);}
else {txt[i]->SetPosition(130, y);}
i++; i++;
y+=22; y+=22;
@ -313,8 +302,7 @@ static void WindowCredits(void * ptr)
i++; i++;
txt[i] = new GuiText(LANGUAGE.For); txt[i] = new GuiText(LANGUAGE.For);
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); //txt[i]->SetPosition(-3,y); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); //txt[i]->SetPosition(-3,y);
if ((pch!=NULL)||(pch2!=NULL)){txt[i]->SetPosition(-3, y+5);} txt[i]->SetPosition(-3, y);
else {txt[i]->SetPosition(-3, y);}
i++; i++;
y+=22; y+=22;
@ -323,8 +311,7 @@ static void WindowCredits(void * ptr)
i++; i++;
txt[i] = new GuiText(LANGUAGE.For); txt[i] = new GuiText(LANGUAGE.For);
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(30,y); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(30,y);
if ((pch!=NULL)||(pch2!=NULL)){txt[i]->SetPosition(30, y+5);} txt[i]->SetPosition(30, y);
else {txt[i]->SetPosition(30, y);}
i++; i++;
y+=22; y+=22;
@ -1308,12 +1295,7 @@ int GameWindowPrompt()
playcntTxt.SetText(PlayCnt); playcntTxt.SetText(PlayCnt);
btnFavoriteImg.SetImage(faveChoice ? &imgFavorite : &imgNotFavorite); btnFavoriteImg.SetImage(faveChoice ? &imgFavorite : &imgNotFavorite);
char* pch; nameTxt.SetPosition(0, 1);
pch=strrchr((gameName),'_');
if (pch!=NULL){nameTxt.SetPosition(0, 16);}
else {nameTxt.SetPosition(0, 1);}
if(changed != 3 && changed != 4) // changed==3 or changed==4 --> only Resume the GUI if(changed != 3 && changed != 4) // changed==3 or changed==4 --> only Resume the GUI
{ {