-added cat_page fix to sourceflow and now wiiflow checks custom banner folder first before cached

This commit is contained in:
fledge68 2013-10-28 18:36:52 +00:00
parent ff3504d691
commit 82ba28bd02
2 changed files with 36 additions and 34 deletions

View File

@ -1624,17 +1624,9 @@ void CMenu::_gameSoundThread(CMenu *m)
char cached_banner[256]; char cached_banner[256];
cached_banner[255] = '\0'; cached_banner[255] = '\0';
strncpy(cached_banner, fmt("%s/%s.bnr", m->m_bnrCacheDir.c_str(), GameHdr->id), 255);
fsop_GetFileSizeBytes(cached_banner, &cached_bnr_size);
if(cached_bnr_size > 0 && cached_bnr_size < BNR_MAX_SIZE)
{
cached_bnr_file = BNR_LOC;
fsop_ReadFileLoc(cached_banner, cached_bnr_size, BNR_LOC);
}
else /* no cached or too big */
{
char custom_banner[256]; char custom_banner[256];
custom_banner[255] = '\0'; custom_banner[255] = '\0';
/* check custom ID6 first */
strncpy(custom_banner, fmt("%s/%s.bnr", m->m_customBnrDir.c_str(), GameHdr->id), 255); strncpy(custom_banner, fmt("%s/%s.bnr", m->m_customBnrDir.c_str(), GameHdr->id), 255);
fsop_GetFileSizeBytes(custom_banner, &custom_bnr_size); fsop_GetFileSizeBytes(custom_banner, &custom_bnr_size);
if(custom_bnr_size > 0 && custom_bnr_size < BNR_MAX_SIZE) if(custom_bnr_size > 0 && custom_bnr_size < BNR_MAX_SIZE)
@ -1668,12 +1660,21 @@ void CMenu::_gameSoundThread(CMenu *m)
m->m_soundThrdBusy = false; m->m_soundThrdBusy = false;
return; return;
} }
if(custom_bnr_file == NULL)/* no custom and not GC game try cached banner*/
{
strncpy(cached_banner, fmt("%s/%s.bnr", m->m_bnrCacheDir.c_str(), GameHdr->id), 255);
fsop_GetFileSizeBytes(cached_banner, &cached_bnr_size);
if(cached_bnr_size > 0 && cached_bnr_size < BNR_MAX_SIZE)
{
cached_bnr_file = BNR_LOC;
fsop_ReadFileLoc(cached_banner, cached_bnr_size, BNR_LOC);
}
} }
if(cached_bnr_file != NULL) if(custom_bnr_file != NULL)
CurrentBanner.SetBanner(cached_bnr_file, cached_bnr_size);
else if(custom_bnr_file != NULL)
CurrentBanner.SetBanner(custom_bnr_file, custom_bnr_size, true); CurrentBanner.SetBanner(custom_bnr_file, custom_bnr_size, true);
else if(cached_bnr_file != NULL)
CurrentBanner.SetBanner(cached_bnr_file, cached_bnr_size);
else if(GameHdr->type == TYPE_WII_GAME) else if(GameHdr->type == TYPE_WII_GAME)
_extractBnr(GameHdr); _extractBnr(GameHdr);
else if(GameHdr->type == TYPE_CHANNEL) else if(GameHdr->type == TYPE_CHANNEL)

View File

@ -266,6 +266,7 @@ void CMenu::_sourceFlow()
memset(btn_selected, 0, 256); memset(btn_selected, 0, 256);
strncpy(btn_selected, fmt("BUTTON_%i", hdr->settings[0]), 255); strncpy(btn_selected, fmt("BUTTON_%i", hdr->settings[0]), 255);
string source = m_source.getString(btn_selected, "source", ""); string source = m_source.getString(btn_selected, "source", "");
m_cfg.setInt("GENERAL", "last_source_btn", hdr->settings[0]);
_clearSources(); _clearSources();
if(source == "wii") if(source == "wii")
{ {