-displaying game name without extension in emulator coverflow

now, covers now also dont need extension anymore
This commit is contained in:
fix94.1 2012-04-26 18:43:05 +00:00
parent fc266e0fe1
commit fe887eb0ff
2 changed files with 15 additions and 8 deletions

View File

@ -401,18 +401,19 @@ void CList<dir_discHdr>::GetHeaders(safe_vector<string> pathlist, safe_vector<di
{ {
strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path)); strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path));
(*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]);
char filename[64];
strncpy(filename, (*itr).c_str(), sizeof(filename));
int plugin_ccolor; int plugin_ccolor;
sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &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(); int ccolor = custom_titles.getColor("COVERS", (const char *) tmp.hdr.id, plugin_ccolor).intVal();
tmp.hdr.casecolor = ccolor != plugin_ccolor ? ccolor : plugin_ccolor; tmp.hdr.casecolor = ccolor != plugin_ccolor ? ccolor : plugin_ccolor;
mbstowcs(tmp.title, filename, sizeof(tmp.title)); 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); Asciify(tmp.title);
gprintf("Found: %s\n", tmp.path); gprintf("Found: %s\n", tmp.path);
sscanf(plugin.getString("PLUGIN","magic","").c_str(), "%08x", &tmp.hdr.magic); //Plugin magic sscanf(plugin.getString("PLUGIN","magic","").c_str(), "%08x", &tmp.hdr.magic); //Plugin magic
tmp.hdr.gc_magic = 0x4c4f4c4f; //Abusing gc_magic for general emu detection ;) tmp.hdr.gc_magic = 0x4c4f4c4f; //Abusing gc_magic for general emu detection ;)

View File

@ -1482,7 +1482,13 @@ void CMenu::_initCF(void)
m_dump.setWString(domain, id, m_gameList[i].title); m_dump.setWString(domain, id, m_gameList[i].title);
if (m_current_view == COVERFLOW_EMU) if (m_current_view == COVERFLOW_EMU)
m_cf.addItem(&m_gameList[i], sfmt("%s/%s.png", m_picDir.c_str(), &m_gameList[i].path[std::string(m_gameList[i].path).find_last_of("/")]).c_str(), sfmt("%s/%s.png", m_boxPicDir.c_str(), &m_gameList[i].path[std::string(m_gameList[i].path).find_last_of("/")]).c_str(), playcount, lastPlayed); {
string tempname(m_gameList[i].path);
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
if(tempname.find_last_of('.') != string::npos)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
m_cf.addItem(&m_gameList[i], sfmt("%s/%s.png", m_picDir.c_str(), tempname.c_str()).c_str(), sfmt("%s/%s.png", m_boxPicDir.c_str(), tempname.c_str()).c_str(), playcount, lastPlayed);
}
else if (m_current_view != COVERFLOW_HOMEBREW) else if (m_current_view != COVERFLOW_HOMEBREW)
m_cf.addItem(&m_gameList[i], sfmt("%s/%s.png", m_picDir.c_str(), id.c_str()).c_str(), sfmt("%s/%s.png", m_boxPicDir.c_str(), id.c_str()).c_str(), playcount, lastPlayed); m_cf.addItem(&m_gameList[i], sfmt("%s/%s.png", m_picDir.c_str(), id.c_str()).c_str(), sfmt("%s/%s.png", m_boxPicDir.c_str(), id.c_str()).c_str(), playcount, lastPlayed);
else else