*Little changes in code

This commit is contained in:
dimok321 2009-05-07 10:38:10 +00:00
parent 3ab00deca6
commit fb1d6aadf9

View File

@ -72,8 +72,6 @@ static lwp_t guithread = LWP_THREAD_NULL;
static bool guiHalt = true; static bool guiHalt = true;
static GuiImageData progressbar(progressbar_png); static GuiImageData progressbar(progressbar_png);
static GuiImage progressbarImg(&progressbar); static GuiImage progressbarImg(&progressbar);
static double progressDone = 0;
static double progressTotal = 1;
int godmode = 0; int godmode = 0;
int height = 224; int height = 224;
int width = 160; int width = 160;
@ -1517,9 +1515,6 @@ ShowProgress (s32 done, s32 total)
percent = (done * 100.0) / total; percent = (done * 100.0) / total;
//size = (hdd->wbfs_sec_sz / GB_SIZE) * total; //size = (hdd->wbfs_sec_sz / GB_SIZE) * total;
progressTotal = total;
progressDone = done;
sprintf(prozent, "%0.2f", percent); sprintf(prozent, "%0.2f", percent);
prTxt.SetText(prozent); prTxt.SetText(prozent);
//prTxt.SetFont(fontClock); //prTxt.SetFont(fontClock);
@ -1528,15 +1523,15 @@ ShowProgress (s32 done, s32 total)
float gamesizedone = 0.00; float gamesizedone = 0.00;
gamesizedone = gamesize * progressDone/progressTotal; gamesizedone = gamesize * done/total;
sprintf(sizeshow,"%0.2fGB/%0.2fGB", gamesizedone, gamesize); sprintf(sizeshow,"%0.2fGB/%0.2fGB", gamesizedone, gamesize);
sizeTxt.SetText(sizeshow); sizeTxt.SetText(sizeshow);
// timeTxt.SetFont(fontClock); // timeTxt.SetFont(fontClock);
if ((Settings.wsprompt == yes) && (CFG.widescreen)){ if ((Settings.wsprompt == yes) && (CFG.widescreen)){
progressbarImg.SetTile(80*progressDone/progressTotal);} progressbarImg.SetTile(80*done/total);}
else {progressbarImg.SetTile(100*progressDone/progressTotal);} else {progressbarImg.SetTile(100*done/total);}
} }
@ -1632,8 +1627,11 @@ ProgressWindow(const char *title, const char *msg)
ResumeGui(); ResumeGui();
promptWindow.Append(&prTxt); promptWindow.Append(&prTxt);
promptWindow.Append(&sizeTxt); promptWindow.Append(&sizeTxt);
s32 ret; s32 ret;
__Disc_SetLowMem();
ret = wbfs_add_disc(hdd, __WBFS_ReadDVD, NULL, ShowProgress, ONLY_GAME_PARTITION, 0); ret = wbfs_add_disc(hdd, __WBFS_ReadDVD, NULL, ShowProgress, ONLY_GAME_PARTITION, 0);
HaltGui(); HaltGui();
@ -2231,11 +2229,11 @@ static int MenuInstall()
Disc_ReadHeader(&headerdisc); Disc_ReadHeader(&headerdisc);
name = headerdisc.title; name = headerdisc.title;
if (strlen(name) < (22 + 3)) { if (strlen(name) < (34 + 3)) {
memset(buffer, 0, sizeof(buffer)); memset(buffer, 0, sizeof(buffer));
sprintf(name, "%s", name); sprintf(name, "%s", name);
} else { } else {
strncpy(buffer, name, MAX_CHARACTERS); strncpy(buffer, name, 34);
strncat(buffer, "...", 3); strncat(buffer, "...", 3);
sprintf(name, "%s", buffer); sprintf(name, "%s", buffer);
} }