-fixed scummvm games not showing anymore

This commit is contained in:
fix94.1 2012-05-29 13:49:28 +00:00
parent 9f0a4d5a66
commit cd9b3ca394
3 changed files with 31 additions and 15 deletions

View File

@ -1515,23 +1515,28 @@ void CMenu::_initCF(void)
if(m_current_view == COVERFLOW_EMU) if(m_current_view == COVERFLOW_EMU)
{ {
string tempname(m_gameList[i].path); string tempname(m_gameList[i].path);
if(tempname.empty() || tempname.find_first_of('/') == string::npos) if(!m_plugin.isScummVM(m_gameList[i].hdr.magic))
{ {
continue; if(tempname.empty() || tempname.find_first_of('/') == string::npos)
{
continue;
}
tempname.erase(0, tempname.find_first_of('/')+1);
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
if (tempname.find_first_of('/') == string::npos)
{
continue;
}
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
if(tempname.find_last_of('.') == string::npos)
{
continue;
}
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
} }
tempname.erase(0, tempname.find_first_of('/')+1); else
string dirName = tempname.substr(0, tempname.find_first_of('/')+1); id = tempname;
if (tempname.find_first_of('/') == string::npos)
{
continue;
}
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
if(tempname.find_last_of('.') == string::npos)
{
continue;
}
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
} }
else else
id = string((const char *)m_gameList[i].hdr.id, m_current_view == COVERFLOW_CHANNEL ? 4 : 6); id = string((const char *)m_gameList[i].hdr.id, m_current_view == COVERFLOW_CHANNEL ? 4 : 6);

View File

@ -22,6 +22,7 @@ static char* emptyChar = (char*)" ";
void Plugin::init(string m_pluginsDir) void Plugin::init(string m_pluginsDir)
{ {
ScummVM_magic = 0;
pluginsDir = m_pluginsDir; pluginsDir = m_pluginsDir;
//Ready to add plugins //Ready to add plugins
adding = true; adding = true;
@ -192,6 +193,8 @@ vector<dir_discHdr> Plugin::ParseScummvmINI(Config &ini, string Device)
vector<dir_discHdr> gameHeader; vector<dir_discHdr> gameHeader;
if(!ini.loaded()) if(!ini.loaded())
return gameHeader; return gameHeader;
ScummVM_magic = Plugins[Plugins.size()-1].magicWord;
string game(ini.firstDomain()); string game(ini.firstDomain());
string GameName; string GameName;
dir_discHdr tmp; dir_discHdr tmp;
@ -265,3 +268,8 @@ bool Plugin::isMplayerCE(u32 magic)
return (Plugins[Plugin_Pos].magicWord == 0x4D504345); return (Plugins[Plugin_Pos].magicWord == 0x4D504345);
return false; return false;
} }
bool Plugin::isScummVM(u32 magic)
{
return (magic == ScummVM_magic);
}

View File

@ -49,12 +49,15 @@ public:
void Cleanup(); void Cleanup();
void EndAdd(); void EndAdd();
vector<dir_discHdr> ParseScummvmINI(Config &ini, string Device); vector<dir_discHdr> ParseScummvmINI(Config &ini, string Device);
bool isScummVM(u32 magic);
private: private:
s8 GetPluginPosition(u32 magic); s8 GetPluginPosition(u32 magic);
vector<PluginOptions> Plugins; vector<PluginOptions> Plugins;
s8 Plugin_Pos; s8 Plugin_Pos;
string pluginsDir; string pluginsDir;
u32 ScummVM_magic;
bool adding; bool adding;
}; };
#endif #endif