From 5d4f55d3338bb03710e3619340e3280de8351d62 Mon Sep 17 00:00:00 2001 From: DRayX7 Date: Tue, 26 May 2009 22:51:17 +0000 Subject: [PATCH] *Fixed parental control (I think). *Fixed a small issue with displaying svn number. --- source/menu.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/source/menu.cpp b/source/menu.cpp index 96db0af2..086696b2 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -210,9 +210,10 @@ static void WindowCredits(void * ptr) GuiText * txt[numEntries]; txt[i] = new GuiText(LANGUAGE.Credits, 26, (GXColor){255, 255, 255, 255}); - txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0,12); i++; + txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0,12); i++; - char SvnRev[10]; snprintf(SvnRev, 7, "Rev%s", SVN_REV); + char SvnRev[10]; + snprintf(SvnRev, 10, "Rev%s", SVN_REV); txt[i] = new GuiText(SvnRev, 18, (GXColor){255, 255, 255, 255}); txt[i]->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); txt[i]->SetPosition(0,y); i++; y+=34; @@ -1067,7 +1068,7 @@ int GameWindowPrompt() diskImg2.SetAngle(angle); diskImg2.SetBeta(180); - char PlayCnt[25] = ""; + char PlayCnt[25]; GuiText playcntTxt(PlayCnt, 18, (GXColor){THEME.info_r, THEME.info_g, THEME.info_b, 255}); playcntTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); playcntTxt.SetPosition(-115,45); @@ -2446,23 +2447,22 @@ s32 __Menu_GetEntries(void) cnt = cnt2; } - if (CFG.parentalcontrol && !CFG.godmode) - { - u32 cnt3 = 0; + if (CFG.parentalcontrol && !CFG.godmode) { + u32 cnt2 = 0; for (u32 i = 0; i < cnt; i++) - { - if (get_block(header) < CFG.parentalcontrol) - { - buffer2 = (discHdr *) realloc(buffer2, (cnt3+1) * sizeof(struct discHdr)); + { + header = &buffer[i]; + if (get_block(header) < CFG.parentalcontrol) { + buffer2 = (discHdr *) realloc(buffer2, (cnt2+1) * sizeof(struct discHdr)); if (!buffer2) { free(buffer); return -1; } - memcpy((buffer2 + cnt3), (buffer + i), sizeof(struct discHdr)); - cnt3++; + memcpy((buffer2 + cnt2), (buffer + i), sizeof(struct discHdr)); + cnt2++; } } if (buffer2) { @@ -2472,7 +2472,7 @@ s32 __Menu_GetEntries(void) } else { memset(buffer, 0, len); } - cnt = cnt3; + cnt = cnt2; } if (Settings.sort==pcount) {