*Better fix for zero entries (fixes teh problem instead of avoiding it)

*Moved a button
This commit is contained in:
DRayX7 2009-05-21 18:26:01 +00:00
parent 4cb00becda
commit 59905d623d
2 changed files with 27 additions and 27 deletions

View File

@ -643,24 +643,16 @@ void GuiGameBrowser::Update(GuiTrigger * t)
if(updateCB)
updateCB(this);
}
}
void GuiGameBrowser::Reload(struct discHdr * l, int count)
{
LOCK(this);
gameList = l;
gameCnt = count;
if (gameCnt == 0) {
focus = 0;
dontsetfocus = 1;
} else {
dontsetfocus = 0;
focus = 1;
selectedItem = 0;
}
gameList = l;
scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0;
pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt;
gameList = l;
gameCnt = count;
scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0;
pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt;
selectedItem = 0;
listOffset = 0;
for(int i=0; i<pagesize; i++)

View File

@ -772,7 +772,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
GuiButton closeBtn(close.GetWidth(), close.GetHeight());
closeBtn.SetImage(&closeImg);
closeBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
closeBtn.SetPosition(220,48);
closeBtn.SetPosition(205,40);
closeBtn.SetLabel(&closeTxt);
closeBtn.SetRumble(false);
closeBtn.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
@ -2407,36 +2407,44 @@ s32 __Menu_GetEntries(void)
memcpy((buffer2 + cnt2), (buffer + i), sizeof(struct discHdr));
cnt2++;
}
}
if (buffer2) {
free(buffer);
buffer = buffer2;
buffer2 = NULL;
} else {
memset(buffer, 0, len);
}
free(buffer);
buffer = buffer2;
buffer2 = NULL;
cnt = cnt2;
}
if (CFG.parentalcontrol && !CFG.godmode)
{
u32 cnt2 = 0;
u32 cnt3 = 0;
for (u32 i = 0; i < cnt; i++)
{
if (get_block(header) < CFG.parentalcontrol)
{
buffer2 = (discHdr *) realloc(buffer2, (cnt2+1) * sizeof(struct discHdr));
buffer2 = (discHdr *) realloc(buffer2, (cnt3+1) * sizeof(struct discHdr));
if (!buffer2)
{
free(buffer);
return -1;
}
memcpy((buffer2 + cnt2), (buffer + i), sizeof(struct discHdr));
cnt2++;
memcpy((buffer2 + cnt3), (buffer + i), sizeof(struct discHdr));
cnt3++;
}
}
if (buffer2) {
free(buffer);
buffer = buffer2;
buffer2 = NULL;
} else {
memset(buffer, 0, len);
}
free(buffer);
buffer = buffer2;
buffer2 = NULL;
cnt = cnt2;
cnt = cnt3;
}
if (Settings.sort==pcount) {