-fixed bin and iso files not displayed in emulator coverflow

-removed hide settings button if no game found to reload cache
This commit is contained in:
fix94.1 2012-05-25 22:05:38 +00:00
parent 13183666d9
commit 1bd07dc6dc
2 changed files with 41 additions and 41 deletions

View File

@ -149,9 +149,47 @@ void CList<dir_discHdr>::GetHeaders(vector<string> pathlist, vector<dir_discHdr>
strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path));
tmp.hdr.index = headerlist.size();
tmp.hdr.casecolor = 1;
bool wbfs = (*itr).rfind(".wbfs") != string::npos || (*itr).rfind(".WBFS") != string::npos;
if (wbfs || (*itr).rfind(".iso") != string::npos || (*itr).rfind(".ISO") != string::npos
if(plugin.loaded())
{
vector<string> types = plugin.getStrings("PLUGIN","fileTypes",'|');
if (types.size() > 0)
{
for(vector<string>::iterator type_itr = types.begin(); type_itr != types.end(); type_itr++)
{
if(lowerCase(*itr).rfind((*type_itr).c_str()) != string::npos)
{
strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path));
int plugin_ccolor;
sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &plugin_ccolor);
int ccolor = custom_titles.getColor("COVERS", (const char *) tmp.hdr.id, plugin_ccolor).intVal();
tmp.hdr.casecolor = ccolor != plugin_ccolor ? ccolor : plugin_ccolor;
char tempname[64];
(*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]);
if((*itr).find_last_of('.') != string::npos)
(*itr).erase((*itr).find_last_of('.'), (*itr).size() - (*itr).find_last_of('.'));
strncpy(tempname, (*itr).c_str(), sizeof(tempname));
//mbstowcs(tmp.title, tempname, sizeof(tmp.title));
//Asciify(tmp.title);
wstringEx tmpString;
tmpString.fromUTF8(tempname);
wcsncpy(tmp.title, tmpString.c_str(), 64);
gprintf("Found: %s\n", tmp.path);
sscanf(plugin.getString("PLUGIN","magic","").c_str(), "%08x", &tmp.hdr.magic); //Plugin magic
tmp.hdr.gc_magic = EMU_MAGIC; //Abusing gc_magic for general emu detection ;)
headerlist.push_back(tmp);
break;
}
}
}
continue;
}
else if (wbfs || (*itr).rfind(".iso") != string::npos || (*itr).rfind(".ISO") != string::npos
|| (*itr).rfind(".bin") != string::npos || (*itr).rfind(".BIN") != string::npos)
{
char* filename = &(*itr)[(*itr).find_last_of('/')+1];
@ -418,43 +456,6 @@ void CList<dir_discHdr>::GetHeaders(vector<string> pathlist, vector<dir_discHdr>
}
continue;
}
else if(plugin.loaded())
{
vector<string> types = plugin.getStrings("PLUGIN","fileTypes",'|');
if (types.size() > 0)
{
for(vector<string>::iterator type_itr = types.begin(); type_itr != types.end(); type_itr++)
{
if(lowerCase(*itr).rfind((*type_itr).c_str()) != string::npos)
{
strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path));
int plugin_ccolor;
sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &plugin_ccolor);
int ccolor = custom_titles.getColor("COVERS", (const char *) tmp.hdr.id, plugin_ccolor).intVal();
tmp.hdr.casecolor = ccolor != plugin_ccolor ? ccolor : plugin_ccolor;
char tempname[64];
(*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]);
if((*itr).find_last_of('.') != string::npos)
(*itr).erase((*itr).find_last_of('.'), (*itr).size() - (*itr).find_last_of('.'));
strncpy(tempname, (*itr).c_str(), sizeof(tempname));
//mbstowcs(tmp.title, tempname, sizeof(tmp.title));
//Asciify(tmp.title);
wstringEx tmpString;
tmpString.fromUTF8(tempname);
wcsncpy(tmp.title, tmpString.c_str(), 64);
gprintf("Found: %s\n", tmp.path);
sscanf(plugin.getString("PLUGIN","magic","").c_str(), "%08x", &tmp.hdr.magic); //Plugin magic
tmp.hdr.gc_magic = EMU_MAGIC; //Abusing gc_magic for general emu detection ;)
headerlist.push_back(tmp);
break;
}
}
}
continue;
}
}
if(gameTDB.IsLoaded())

View File

@ -173,7 +173,7 @@ void CMenu::_showMain(void)
m_btnMgr.show(m_mainBtnInit2);
m_btnMgr.show(m_mainLblInit);
break;
}
}
}
}
@ -708,7 +708,6 @@ int CMenu::main(void)
{
m_btnMgr.hide(m_mainLblUser[0]);
m_btnMgr.hide(m_mainLblUser[1]);
m_btnMgr.hide(m_mainBtnConfig);
m_btnMgr.hide(m_mainBtnInfo);
m_btnMgr.hide(m_mainBtnQuit);
m_btnMgr.hide(m_mainBtnFavoritesOn);