-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,6 +1515,8 @@ void CMenu::_initCF(void)
if(m_current_view == COVERFLOW_EMU)
{
string tempname(m_gameList[i].path);
if(!m_plugin.isScummVM(m_gameList[i].hdr.magic))
{
if(tempname.empty() || tempname.find_first_of('/') == string::npos)
{
continue;
@ -1533,6 +1535,9 @@ void CMenu::_initCF(void)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
}
else
id = tempname;
}
else
id = string((const char *)m_gameList[i].hdr.id, m_current_view == COVERFLOW_CHANNEL ? 4 : 6);
string idcats = m_cat.getString("CATEGORIES", id, "").c_str();

View File

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

View File

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