diff --git a/source/FreeTypeGX.cpp b/source/FreeTypeGX.cpp index fa190e53..fcf087e7 100644 --- a/source/FreeTypeGX.cpp +++ b/source/FreeTypeGX.cpp @@ -150,9 +150,9 @@ void FreeTypeGX::InitFreeType(uint8_t* fontBuffer, FT_Long bufferSize, bool load ftSlot = ftFace->glyph; } -void FreeTypeGX::ChangeFontSize(FT_UInt pixelSize) +void FreeTypeGX::ChangeFontSize(FT_UInt pixelSize, FT_UInt pixelSizeHorz) { - FT_Set_Pixel_Sizes(ftFace, 0, pixelSize); + FT_Set_Pixel_Sizes(ftFace, pixelSizeHorz, pixelSize); } uint8_t FreeTypeGX::GetMaxCharWidth() diff --git a/source/FreeTypeGX.h b/source/FreeTypeGX.h index 49e820ad..a093a5c0 100644 --- a/source/FreeTypeGX.h +++ b/source/FreeTypeGX.h @@ -286,7 +286,7 @@ class FreeTypeGX { ~FreeTypeGX(); void InitFreeType(uint8_t* fontBuffer, FT_Long bufferSize, bool loadcustomfont); - void ChangeFontSize(FT_UInt pixelSize); + void ChangeFontSize(FT_UInt pixelSize, FT_UInt pixelSizeHorz = 0); uint8_t GetMaxCharWidth(); void setVertexFormat(uint8_t vertexIndex); diff --git a/source/homebrewboot/HomebrewBrowse.cpp b/source/homebrewboot/HomebrewBrowse.cpp index d54ef407..f3c440f0 100644 --- a/source/homebrewboot/HomebrewBrowse.cpp +++ b/source/homebrewboot/HomebrewBrowse.cpp @@ -150,7 +150,7 @@ int MenuHomebrewBrowse() { backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //backBtnTxt.SetWidescreen(CFG.widescreen); + backBtnTxt.SetWidescreen(CFG.widescreen); backBtnImg.SetWidescreen(CFG.widescreen); } GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -180, 400, &trigA, &btnSoundOver, &btnClick,1); @@ -838,29 +838,29 @@ int MenuHomebrewBrowse() { read += result; } - + char filename[101]; if (!error) { - + network_read((u8*) &filename, 100); - + // Do we need to unzip this thing? if (wiiloadVersion[0] > 0 || wiiloadVersion[1] > 4) { // We need to unzip... if (temp[0] == 'P' && temp[1] == 'K' && temp[2] == 0x03 && temp[3] == 0x04) { // It's a zip file, unzip to the apps directory - + // Zip archive, ask for permission to install the zip char zippath[255]; sprintf((char *) &zippath, "%s%s", Settings.homebrewapps_path, filename); - + FILE *fp = fopen(zippath, "wb"); if (fp != NULL) { fwrite(temp, 1, infilesize, fp); fclose(fp); - + // Now unzip the zip file... unzFile uf = unzOpen(zippath); if (uf==NULL) { @@ -868,9 +868,9 @@ int MenuHomebrewBrowse() { } else { extractZip(uf,0,1,0, Settings.homebrewapps_path); unzCloseCurrentFile(uf); - + remove(zippath); - + // Reload this menu here... menu = MENU_HOMEBREWBROWSE; break; @@ -884,17 +884,17 @@ int MenuHomebrewBrowse() { uLongf f = uncfilesize; error = uncompress(unc, &f, temp, infilesize) != Z_OK; uncfilesize = f; - + free(temp); temp = unc; } } - + if (!error && strstr(filename,".zip") == NULL) { innetbuffer = temp; } } - + ProgressStop(); if (error || read != infilesize) { diff --git a/source/libwiigui/gui.h b/source/libwiigui/gui.h index c8062616..9b743523 100644 --- a/source/libwiigui/gui.h +++ b/source/libwiigui/gui.h @@ -760,6 +760,8 @@ class GuiText : public GuiElement //!\param font bufferblock //!\param font filesize bool SetFont(const u8 *font, const u32 filesize); + //!SetWidescreen + void SetWidescreen(bool w); //!Constantly called to draw the text void Draw(); protected: diff --git a/source/libwiigui/gui_text.cpp b/source/libwiigui/gui_text.cpp index 13679517..cc9ce035 100644 --- a/source/libwiigui/gui_text.cpp +++ b/source/libwiigui/gui_text.cpp @@ -38,7 +38,7 @@ GuiText::GuiText(const char * t, int s, GXColor c) firstLine = 0; linestodraw = 8; totalLines = 0; - widescreen = 0; //added + widescreen = false; //added LineBreak = NULL; textDyn = NULL; font = NULL; @@ -85,7 +85,7 @@ GuiText::GuiText(const char * t) firstLine = 0; linestodraw = 8; totalLines = 0; - widescreen = 0; //added + widescreen = false; //added LineBreak = NULL; textDyn = NULL; font = NULL; @@ -211,7 +211,11 @@ void GuiText::SetText(const wchar_t * t) { int len = wcslen(t); text = new wchar_t[len+1]; - if(text) wcscpy(text, t); + if(text) + { + wcscpy(text, t); + textWidth = fontSystem[currentSize]->getWidth(text); + } } } @@ -465,6 +469,12 @@ bool GuiText::SetFont(const u8 *fontbuffer, const u32 filesize) return true; } +void GuiText::SetWidescreen(bool w) +{ + LOCK(this); + widescreen = w; +} + /** * Draw the text on screen */ @@ -498,6 +508,9 @@ void GuiText::Draw() currentSize = newSize; } + if(widescreen) + (font ? font : fontSystem[currentSize])->ChangeFontSize(currentSize, currentSize*0.8); + if(maxWidth > 0 && maxWidth <= textWidth) { if(wrapMode == LONGTEXT) // text wrapping @@ -711,4 +724,7 @@ void GuiText::Draw() (font ? font : fontSystem[currentSize])->drawText(this->GetLeft(), this->GetTop(), text, c, style); } this->UpdateEffects(); + + if(widescreen) + (font ? font : fontSystem[currentSize])->ChangeFontSize(currentSize, 0); } diff --git a/source/prompts/DiscBrowser.cpp b/source/prompts/DiscBrowser.cpp index 419a1d4c..006e3ecb 100644 --- a/source/prompts/DiscBrowser.cpp +++ b/source/prompts/DiscBrowser.cpp @@ -50,7 +50,7 @@ int DiscBrowse(struct discHdr * header) { return ret; } } - + ret = Disc_Open(); if (ret < 0) { ResumeGui(); @@ -71,7 +71,7 @@ int DiscBrowse(struct discHdr * header) { WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK")); return ret; } - + int *buffer = (int*)allocate_memory(0x20); if (buffer == NULL) { @@ -86,7 +86,7 @@ int DiscBrowse(struct discHdr * header) { WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK")); return ret; } - + void *fstbuffer = allocate_memory(buffer[2]*4); FST_ENTRY *fst = (FST_ENTRY *)fstbuffer; @@ -173,7 +173,7 @@ int DiscBrowse(struct discHdr * header) { cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //cancelBtnTxt.SetWidescreen(CFG.widescreen); + cancelBtnTxt.SetWidescreen(CFG.widescreen); cancelBtnImg.SetWidescreen(CFG.widescreen); } GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, &btnClick,1); @@ -241,29 +241,29 @@ int autoSelectDol(const char *id, bool force) { char id4[10]; sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]); - + ////// games that can be forced (always need alt dol) - //Boogie + //Boogie if (strcmp(id,"RBOP69") == 0) return 675;//previous value was 657 if (strcmp(id,"RBOE69") == 0) return 675;//starstremr - + //Fifa 08 if (strcmp(id,"RF8E69") == 0) return 439;//from isostar if (strcmp(id,"RF8P69") == 0) return 463;//from isostar if (strcmp(id,"RF8X69") == 0) return 464;//from isostar - + //Madden NFL07 if (strcmp(id,"RMDP69") == 0) return 39;//from isostar - + //Madden NFL08 if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar - + //Medal of Honor: Heroes 2 if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual if (strcmp(id,"RM2P69") == 0)return 517;//MZottel - if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy - + if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy + //Mortal Kombat if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar if (strcmp(id,"RKME5D") == 0) return 290;//starstremr @@ -273,7 +273,7 @@ int autoSelectDol(const char *id, bool force) { //Pangya! Golf with Style if (strcmp(id,"RPYP9B") == 0) return 12490;//from isostar - + //Redsteel if (strcmp(id,"REDP41") == 0) return 1957;//from isostar if (strcmp(id,"REDE41") == 0) return 1957;//starstremr @@ -281,37 +281,37 @@ int autoSelectDol(const char *id, bool force) { //SSX if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337 if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337 - + //Wii Sports Resort, needs alt dol one time only, to show the Motion Plus video //if (strcmp(id,"RZTP01") == 0 && CheckForSave(id4)==0) return 952;//from isostar //if (strcmp(id,"RZTE01") == 0 && CheckForSave(id4)==0) return 674;//from starstremr //as well as Grand Slam Tennis, Tiger Woods 10, Virtual Tennis 2009 - + ///// games that can't be forced (alt dol is not always needed) if (!force) { - + //Grand Slam Tennis if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr - + //Medal of Honor Heroes if (strcmp(id,"RMZX69") == 0) return 492;//from isostar if (strcmp(id,"RMZP69") == 0) return 492;//from isostar - if (strcmp(id,"RMZE69") == 0) return 492;//starstremr - + if (strcmp(id,"RMZE69") == 0) return 492;//starstremr + //Tiger Woods 10 if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr - + //Virtual Tennis 2009 if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar - + //Wii Sports Resort if (strcmp(id,"RZTP01") == 0) return 952;//from isostar if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr } - + return -1; } @@ -320,7 +320,7 @@ int autoSelectDolMenu(const char *id, bool force) { /* char id4[10]; sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]); - + switch (CheckForSave(id4)) { case 0: WindowPrompt(tr("NO save"),0,tr("OK")); @@ -336,7 +336,7 @@ int autoSelectDolMenu(const char *id, bool force) { } return -1; */ - + //Indiana Jones and the Staff of Kings (Fate of Atlantis) if (strcmp(id,"RJ8E64") == 0) { int choice = WindowPrompt(tr("Select a DOL"), 0, "Fate of Atlantis", tr("Default")); @@ -362,7 +362,7 @@ int autoSelectDolMenu(const char *id, bool force) { } return choice; } - + //Metal Slug Anthology (Metal Slug 6) if (strcmp(id,"RMLEH4") == 0) { int choice = WindowPrompt(tr("Select a DOL"), 0, "Metal Slug 6", tr("Default")); @@ -388,7 +388,7 @@ int autoSelectDolMenu(const char *id, bool force) { } return choice; } - + //Metroid Prime Trilogy if (strcmp(id,"R3ME01") == 0) { //do not use any alt dol if there is no save game in the nand @@ -439,7 +439,7 @@ int autoSelectDolMenu(const char *id, bool force) { } return choice; } - + //Rampage: Total Destruction (M1.dol=Rampage, jarvos.dol=Rampage World Tour) if (strcmp(id,"RPGP5D") == 0) { int choice = WindowPrompt(tr("Select a DOL"), 0, "Rampage", "World Tour", tr("Default")); @@ -456,7 +456,7 @@ int autoSelectDolMenu(const char *id, bool force) { } return choice; } - + //The House Of The Dead 2 & 3 Return (only to play 2) if (strcmp(id,"RHDE8P") == 0) { int choice = WindowPrompt(tr("Select a DOL"), 0, "HotD 2", tr("Default")); @@ -501,7 +501,7 @@ void __dvd_readidcb(s32 result) u8 DiscMount(discHdr *header) { int ret; HaltGui(); - + u8 *tmpBuff = (u8 *) malloc(0x60); memcpy(tmpBuff, g_diskID, 0x60); // Make a backup of the first 96 bytes at 0x80000000 @@ -509,7 +509,7 @@ u8 DiscMount(discHdr *header) { dvddone = 0; ret = bwDVD_LowReset(__dvd_readidcb); while(ret>=0 && dvddone==0); - + dvddone = 0; ret = bwDVD_LowReadID(g_diskID, __dvd_readidcb); // Leave this one here, or you'll get an IOCTL error while(ret>=0 && dvddone==0); @@ -517,12 +517,12 @@ u8 DiscMount(discHdr *header) { dvddone = 0; ret = bwDVD_LowUnencryptedRead(g_diskID, 0x60, 0x00, __dvd_readidcb); // Overwrite the g_diskID thing while(ret>=0 && dvddone==0); - + memcpy(header, g_diskID, 0x60); memcpy(g_diskID, tmpBuff, 0x60); // Put the backup back, or games won't load free(tmpBuff); - + ResumeGui(); if (dvddone != 1) { return 0; diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index b1b6add9..254e7eb8 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -90,7 +90,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) { GuiText okBtnTxt(tr("OK"), 22, THEME.prompttext); GuiImage okBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //okBtnTxt.SetWidescreen(CFG.widescreen); + okBtnTxt.SetWidescreen(CFG.widescreen); okBtnImg.SetWidescreen(CFG.widescreen); } GuiButton okBtn(&okBtnImg,&okBtnImg, 0, 4, 5, 15, &trigA, &btnSoundOver, &btnClick,1); @@ -98,7 +98,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) { GuiText cancelBtnTxt(tr("Cancel"), 22, THEME.prompttext); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //cancelBtnTxt.SetWidescreen(CFG.widescreen); + cancelBtnTxt.SetWidescreen(CFG.widescreen); cancelBtnImg.SetWidescreen(CFG.widescreen); } GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 1, 4, -5, 15, &trigA, &btnSoundOver, &btnClick,1); @@ -459,7 +459,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, GuiText btn1Txt(btn1Label, 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } @@ -470,7 +470,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, GuiText btn2Txt(btn2Label, 22, THEME.prompttext); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn2Txt.SetWidescreen(CFG.widescreen); + btn2Txt.SetWidescreen(CFG.widescreen); btn2Img.SetWidescreen(CFG.widescreen); } GuiButton btn2(&btn2Img, &btn2Img, 0,3,0,0,&trigA,&btnSoundOver,&btnClick,1); @@ -481,7 +481,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, GuiText btn3Txt(btn3Label, 22, THEME.prompttext); GuiImage btn3Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn3Txt.SetWidescreen(CFG.widescreen); + btn3Txt.SetWidescreen(CFG.widescreen); btn3Img.SetWidescreen(CFG.widescreen); } GuiButton btn3(&btn3Img, &btn3Img, 0,3,0,0,&trigA,&btnSoundOver,&btnClick,1); @@ -492,7 +492,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, GuiText btn4Txt(btn4Label, 22, THEME.prompttext); GuiImage btn4Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn4Txt.SetWidescreen(CFG.widescreen); + btn4Txt.SetWidescreen(CFG.widescreen); btn4Img.SetWidescreen(CFG.widescreen); } GuiButton btn4(&btn4Img, &btn4Img, 0,3,0,0,&trigA,&btnSoundOver,&btnClick,1); @@ -778,7 +778,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, closeTxt.SetPosition(10,3); GuiImage closeImg(&close); if (Settings.wsprompt == yes) { - //closeTxt.SetWidescreen(CFG.widescreen); + closeTxt.SetWidescreen(CFG.widescreen); closeImg.SetWidescreen(CFG.widescreen); } GuiButton closeBtn(close.GetWidth(), close.GetHeight()); @@ -797,7 +797,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, GuiText btn2Txt((HBC!=1?tr("Homebrew Channel"):btn1Label), 28, (GXColor) {0, 0, 0, 255}); GuiImage btn2Img(&button); if (Settings.wsprompt == yes) { - //btn2Txt.SetWidescreen(CFG.widescreen); + btn2Txt.SetWidescreen(CFG.widescreen); btn2Img.SetWidescreen(CFG.widescreen); } GuiButton btn2(&btn2Img,&btn2Img, 2, 5, -150, 0, &trigA, &btnSoundOver, &btnClick,1); @@ -811,7 +811,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, GuiText btn3Txt(btn2Label, 28, (GXColor) {0, 0, 0, 255}); GuiImage btn3Img(&button); if (Settings.wsprompt == yes) { - //btn3Txt.SetWidescreen(CFG.widescreen); + btn3Txt.SetWidescreen(CFG.widescreen); btn3Img.SetWidescreen(CFG.widescreen); } GuiButton btn3(&btn3Img,&btn3Img, 2, 5, 150, 0, &trigA, &btnSoundOver, &btnClick,1); @@ -915,7 +915,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, StopGX(); WII_Initialize(); WII_BootHBC(); - + } choice = 2; } @@ -1001,7 +1001,7 @@ void SetFavoriteImages(GuiImage *b1, GuiImage *b2, GuiImage *b3, GuiImage *b4, G b3->SetImage(favoritevar >= 3 ? on : off); b4->SetImage(favoritevar >= 4 ? on : off); b5->SetImage(favoritevar >= 5 ? on : off); -} +} /**************************************************************************** * GameWindowPrompt @@ -1060,8 +1060,8 @@ int GameWindowPrompt() { if (Settings.wsprompt == yes) nameBtnTT.SetWidescreen(CFG.widescreen); GuiText nameTxt("", 22, THEME.prompttext); - //if (Settings.wsprompt == yes) - //nameTxt.SetWidescreen(CFG.widescreen); + if (Settings.wsprompt == yes) + nameTxt.SetWidescreen(CFG.widescreen); nameTxt.SetMaxWidth(350, SCROLL_HORIZONTAL); GuiButton nameBtn(120,50); nameBtn.SetLabel(&nameTxt); @@ -1110,7 +1110,7 @@ int GameWindowPrompt() { GuiText btn2Txt(tr("Back"), 22, THEME.prompttext); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn2Txt.SetWidescreen(CFG.widescreen); + btn2Txt.SetWidescreen(CFG.widescreen); btn2Img.SetWidescreen(CFG.widescreen); } GuiButton btn2(&btn2Img,&btn2Img, 1, 5, 0, 0, &trigA, &btnSoundOver, &btnClick,1); @@ -1128,7 +1128,7 @@ int GameWindowPrompt() { GuiText btn3Txt(tr("Settings"), 22, THEME.prompttext); GuiImage btn3Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn3Txt.SetWidescreen(CFG.widescreen); + btn3Txt.SetWidescreen(CFG.widescreen); btn3Img.SetWidescreen(CFG.widescreen); } GuiButton btn3(&btn3Img,&btn3Img, 0, 4, 50, -40, &trigA, &btnSoundOver, &btnClick,1); @@ -1226,8 +1226,8 @@ int GameWindowPrompt() { if (diskCover) delete diskCover; - - + + snprintf(imgPath,sizeof(imgPath),"%s%s.png", Settings.disc_path, IDFull); //changed to current full id diskCover = new GuiImageData(imgPath,0); @@ -1298,13 +1298,13 @@ int GameWindowPrompt() { nameTxt.SetEffect(EFFECT_FADE, 17); } else diskImg.SetImage(diskCover); - + if (!mountMethod) { WBFS_GameSize(header->id, &size); sizeTxt.SetTextf("%.2fGB", size); //set size text; } - + nameTxt.SetText(get_title(header)); struct Game_NUM* game_num = CFG_get_game_num(header->id); @@ -1566,7 +1566,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char * GuiText btn1Txt(btn1Label, 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } GuiButton btn1(&btn1Img,&btn1Img, 1, 5, 0, 0, &trigA, &btnSoundOver, &btnClick,1); @@ -1586,7 +1586,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char * GuiText btn2Txt(btn2Label, 22, THEME.prompttext); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn2Txt.SetWidescreen(CFG.widescreen); + btn2Txt.SetWidescreen(CFG.widescreen); btn2Img.SetWidescreen(CFG.widescreen); } GuiButton btn2(&btn2Img,&btn2Img, 1, 4, -20, -25, &trigA, &btnSoundOver, &btnClick,1); @@ -1725,7 +1725,7 @@ FormatingPartition(const char *title, partitionEntry *entry) { * SearchMissingImages ***************************************************************************/ bool SearchMissingImages(int choice2) { - + GuiWindow promptWindow(472,320); promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); @@ -1766,14 +1766,14 @@ bool SearchMissingImages(int choice2) { mainWindow->Append(&promptWindow); mainWindow->ChangeFocus(&promptWindow); ResumeGui(); - + //make sure that all games are added to the gamelist __Menu_GetEntries(1); cntMissFiles = 0; u32 i = 0; char filename[11]; - + //add IDs of games that are missing covers to cntMissFiles bool found1 = false; bool found2 = false; @@ -1781,7 +1781,7 @@ bool SearchMissingImages(int choice2) { for (i = 0; i < gameCnt && cntMissFiles < 500; i++) { struct discHdr* header = &gameList[i]; if (choice2 != 3) { - + char *covers_path = choice2==1 ? Settings.covers2d_path : Settings.covers_path; snprintf (filename,sizeof(filename),"%c%c%c.png", header->id[0], header->id[1], header->id[2]); @@ -1813,7 +1813,7 @@ bool SearchMissingImages(int choice2) { msgTxt.SetText(tr("No file missing!")); sleep(1); } - + promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50); while (promptWindow.GetEffect() > 0) usleep(50); @@ -1822,7 +1822,7 @@ bool SearchMissingImages(int choice2) { mainWindow->SetState(STATE_DEFAULT); __Menu_GetEntries(); ResumeGui(); - + if (cntMissFiles > 0) { //&& !IsNetworkInit()) { NetworkInitPrompt(); } @@ -1872,7 +1872,7 @@ bool NetworkInitPrompt() { GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -45, &trigA, &btnSoundOver, &btnClick,1); @@ -2000,7 +2000,7 @@ ProgressDownloadWindow(int choice2) { GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -45, &trigA, &btnSoundOver, &btnClick,1); @@ -2327,7 +2327,7 @@ ProgressDownloadWindow(int choice2) { } /**Temporary redownloading 1st image because of a fucking corruption bug **/ -#if 0 // is no longer necessary, since libfat is fixed +#if 0 // is no longer necessary, since libfat is fixed char URLFile[100]; struct block file = downloadfile(URLFile); if (choice2 == 2) { @@ -2484,7 +2484,7 @@ int ProgressUpdateWindow() { GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -40, &trigA, &btnSoundOver, &btnClick,1); @@ -2922,7 +2922,7 @@ int ProgressUpdateWindow() { titleTxt.SetTextf("%s USB Loader GX", tr("Updating")); msgTxt.SetPosition(0,100); msgTxt.SetTextf("%s", tr("Updating WiiTDB.zip")); - + char wiitdbpath[200]; char wiitdbpathtmp[200]; struct block file = downloadfile(XMLurl); @@ -2943,7 +2943,7 @@ int ProgressUpdateWindow() { OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory } } - + msgTxt.SetTextf("%s", tr("Updating Language Files:")); updateLanguageFiles(); promptWindow.Append(&progressbarEmptyImg); @@ -3112,7 +3112,7 @@ int CodeDownload(const char *id) { GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -40, &trigA, &btnSoundOver, &btnClick,1); @@ -3350,14 +3350,14 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version, int pagesize = 6; int currentLine = 0; - + GuiText long_descriptionTxt(long_description, 20, THEME.prompttext); long_descriptionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); long_descriptionTxt.SetPosition(46,117); long_descriptionTxt.SetMaxWidth(360, LONGTEXT); long_descriptionTxt.SetLinesToDraw(pagesize); long_descriptionTxt.SetFirstLine(currentLine); - + int TotalLines = long_descriptionTxt.GetTotalLines(); //convert filesize from u64 to char and put unit of measurement after it @@ -3389,7 +3389,7 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version, GuiText btn1Txt(tr("Load"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn1Txt.SetWidescreen(CFG.widescreen); + btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen); } @@ -3400,7 +3400,7 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version, GuiText btn2Txt(tr("Back"), 22, THEME.prompttext); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt == yes) { - //btn2Txt.SetWidescreen(CFG.widescreen); + btn2Txt.SetWidescreen(CFG.widescreen); btn2Img.SetWidescreen(CFG.widescreen); } GuiButton btn2(&btn2Img, &btn2Img, 0,3,0,0,&trigA,&btnSoundOver,&btnClick,1); diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index 28b66d79..4d5294c7 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -121,7 +121,7 @@ int TitleBrowser(u32 type) { char line[200]; char tmp[50]; snprintf(tmp,50," "); - + //check if the content.bin is on the SD card for that game //if there is content.bin,then the game is on the SDmenu and not the wii sprintf(line,"SD:/private/wii/title/%s/content.bin",text); @@ -262,7 +262,7 @@ int TitleBrowser(u32 type) { cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //cancelBtnTxt.SetWidescreen(CFG.widescreen); + cancelBtnTxt.SetWidescreen(CFG.widescreen); cancelBtnImg.SetWidescreen(CFG.widescreen); } GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, &btnClick,1); @@ -406,7 +406,7 @@ int TitleBrowser(u32 type) { char temp[50]; char filepath[100]; u32 read = 0; - + //make sure there is a folder for this to be saved in struct stat st; snprintf(filepath, sizeof(filepath), "%s/wad/", bootDevice); @@ -416,7 +416,7 @@ int TitleBrowser(u32 type) { } } snprintf(filepath, sizeof(filepath), "%s/wad/tmp.tmp", bootDevice); - + if (infilesize < MBSIZE) snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fKB"), infilesize/KBSIZE); @@ -493,17 +493,17 @@ int TitleBrowser(u32 type) { int pick = WindowPrompt(tr(" Wad Saved as:"), tmptxt, tr("Install"),tr("Uninstall"),tr("Cancel")); //install or uninstall it if (pick==1) - { - + { + HaltGui(); w.Remove(&titleTxt); w.Remove(&cancelBtn); w.Remove(&wifiBtn); w.Remove(&optionBrowser3); - ResumeGui(); - + ResumeGui(); + Wad_Install(file); - + HaltGui(); w.Append(&titleTxt); w.Append(&cancelBtn); diff --git a/source/prompts/filebrowser.cpp b/source/prompts/filebrowser.cpp index 005016ef..52015133 100644 --- a/source/prompts/filebrowser.cpp +++ b/source/prompts/filebrowser.cpp @@ -77,7 +77,7 @@ int InitBrowsers() { char rootdir[ROOTDIRLEN]; for(int i=3; iname, "stdnull")) + if(strcmp(devoptab_list[i]->name, "stdnull")) { snprintf(rootdir, sizeof(rootdir) , "%s:/", devoptab_list[i]->name); if(DIR_ITER *dir = diropen(rootdir)) @@ -195,7 +195,7 @@ int ParseDirectory(const char* Path, int Flags, FILTERCASCADE *Filter) { return -1; } if(getcwd(fulldir, sizeof(fulldir))) return -1; // gets the concatenated current working dir - chdir(filename); // restore the saved cwd + chdir(filename); // restore the saved cwd } } for(i=0; idir, &fulldir[strlen(browser->rootdir)]); } else if(Flags & FB_TRYSTDDEV) - { - curDevice = 0; + { + curDevice = 0; browser = &browsers[curDevice]; // when no browser was found and browser->dir[0] = 0; // we alowed try StdDevice and try RootDir strlcpy(fulldir, browser->rootdir, sizeof(fulldir)); // set the first browser with root-dir @@ -315,14 +315,14 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= folderBtn.SetImage(&folderImg); folderBtn.SetTrigger(&trigA); folderBtn.SetEffectGrow(); - + char imgPath[100]; snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); GuiImageData btnOutline(imgPath, button_dialogue_box_png); GuiText ExitBtnTxt(tr("Cancel"), 24, (GXColor) {0, 0, 0, 255}); GuiImage ExitBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //ExitBtnTxt.SetWidescreen(CFG.widescreen); + ExitBtnTxt.SetWidescreen(CFG.widescreen); ExitBtnImg.SetWidescreen(CFG.widescreen); } GuiButton ExitBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); @@ -337,7 +337,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= GuiText usbBtnTxt(browsers[(curDevice+1)%browsers.size()].rootdir, 24, (GXColor) {0, 0, 0, 255}); GuiImage usbBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //usbBtnTxt.SetWidescreen(CFG.widescreen); + usbBtnTxt.SetWidescreen(CFG.widescreen); usbBtnImg.SetWidescreen(CFG.widescreen); } GuiButton usbBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); @@ -351,7 +351,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= GuiText okBtnTxt(tr("OK"), 22, THEME.prompttext); GuiImage okBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //okBtnTxt.SetWidescreen(CFG.widescreen); + okBtnTxt.SetWidescreen(CFG.widescreen); okBtnImg.SetWidescreen(CFG.widescreen); } GuiButton okBtn(&okBtnImg,&okBtnImg, 0, 4, 40, -35, &trigA, &btnSoundOver, &btnClick,1); @@ -422,11 +422,11 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= else if (strcmp(browser->browserList[clickedIndex].filename,".")) { /* test new directory namelength */ - if ((strlen(browser->dir) + strlen(browser->browserList[clickedIndex].filename) + if ((strlen(browser->dir) + strlen(browser->browserList[clickedIndex].filename) + 1/*'/'*/) < MAXPATHLEN) { /* update current directory name */ - sprintf(browser->dir, "%s%s/",browser->dir, + sprintf(browser->dir, "%s%s/",browser->dir, browser->browserList[clickedIndex].filename); pathCanged = true; } @@ -484,7 +484,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= char oldfolder[100]; snprintf(newfolder, sizeof(newfolder), "%s%s", browser->rootdir, browser->dir); strcpy(oldfolder,newfolder); - + int result = OnScreenKeyboard(newfolder, sizeof(newfolder), strlen(browser->rootdir)); if ( result == 1 ) { unsigned int len = strlen(newfolder); diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp index 50cb3ca6..6c19a1a1 100644 --- a/source/settings/Settings.cpp +++ b/source/settings/Settings.cpp @@ -121,7 +121,7 @@ int MenuSettings() { backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //backBtnTxt.SetWidescreen(CFG.widescreen); + backBtnTxt.SetWidescreen(CFG.widescreen); backBtnImg.SetWidescreen(CFG.widescreen); } GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -180, 400, &trigA, &btnSoundOver, &btnClick,1); @@ -1853,7 +1853,7 @@ int GameSettings(struct discHdr * header) { backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //backBtnTxt.SetWidescreen(CFG.widescreen); + backBtnTxt.SetWidescreen(CFG.widescreen); backBtnImg.SetWidescreen(CFG.widescreen); } GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -180, 400, &trigA, &btnSoundOver, &btnClick,1); @@ -1867,7 +1867,7 @@ int GameSettings(struct discHdr * header) { saveBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage saveBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //saveBtnTxt.SetWidescreen(CFG.widescreen); + saveBtnTxt.SetWidescreen(CFG.widescreen); saveBtnImg.SetWidescreen(CFG.widescreen); } GuiButton saveBtn(&saveBtnImg,&saveBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, &btnClick,1); diff --git a/source/settings/SettingsPrompts.cpp b/source/settings/SettingsPrompts.cpp index 7e9cfa22..e30266ad 100644 --- a/source/settings/SettingsPrompts.cpp +++ b/source/settings/SettingsPrompts.cpp @@ -85,7 +85,7 @@ bool MenuOGG() { backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //backBtnTxt.SetWidescreen(CFG.widescreen); + backBtnTxt.SetWidescreen(CFG.widescreen); backBtnImg.SetWidescreen(CFG.widescreen); } GuiButton backBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); @@ -103,7 +103,7 @@ bool MenuOGG() { defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage defaultBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //defaultBtnTxt.SetWidescreen(CFG.widescreen); + defaultBtnTxt.SetWidescreen(CFG.widescreen); defaultBtnImg.SetWidescreen(CFG.widescreen); } GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); @@ -367,7 +367,7 @@ int MenuLanguageSelect() { backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //backBtnTxt.SetWidescreen(CFG.widescreen); + backBtnTxt.SetWidescreen(CFG.widescreen); backBtnImg.SetWidescreen(CFG.widescreen); } GuiButton backBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); @@ -385,7 +385,7 @@ int MenuLanguageSelect() { defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage defaultBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //defaultBtnTxt.SetWidescreen(CFG.widescreen); + defaultBtnTxt.SetWidescreen(CFG.widescreen); defaultBtnImg.SetWidescreen(CFG.widescreen); } GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); @@ -402,7 +402,7 @@ int MenuLanguageSelect() { updateBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage updateBtnImg(&btnOutline); if (Settings.wsprompt == yes) { - //updateBtnTxt.SetWidescreen(CFG.widescreen); + updateBtnTxt.SetWidescreen(CFG.widescreen); updateBtnImg.SetWidescreen(CFG.widescreen); } GuiButton updateBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); diff --git a/source/wad/wad.cpp b/source/wad/wad.cpp index 2f3b7470..4b1d1fa3 100644 --- a/source/wad/wad.cpp +++ b/source/wad/wad.cpp @@ -141,9 +141,11 @@ s32 Wad_Install(FILE *fp) GuiText btn1Txt(tr("OK"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes){ - //btn1Txt.SetWidescreen(CFG.widescreen); - btn1Img.SetWidescreen(CFG.widescreen);} + if (Settings.wsprompt == yes) + { + btn1Txt.SetWidescreen(CFG.widescreen); + btn1Img.SetWidescreen(CFG.widescreen); + } GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -35, &trigA, &btnSoundOver, &btnClick,1); btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); @@ -369,7 +371,7 @@ s32 Wad_Install(FILE *fp) // Increase variables idx += size; offset += size; - + //snprintf(imgPath, sizeof(imgPath), "%s%d (%d)...",tr(">> Installing content #"),content->cid,idx); //msg4Txt.SetText(imgPath); @@ -470,9 +472,11 @@ s32 Wad_Uninstall(FILE *fp) GuiText btn1Txt(tr("OK"), 22, THEME.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes){ - //btn1Txt.SetWidescreen(CFG.widescreen); - btn1Img.SetWidescreen(CFG.widescreen);} + if (Settings.wsprompt == yes) + { + btn1Txt.SetWidescreen(CFG.widescreen); + btn1Img.SetWidescreen(CFG.widescreen); + } GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -55, &trigA, &btnSoundOver, &btnClick,1); btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED);