mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-27 13:44:15 +01:00
-added cache support for emulator coverflow,
should speed up loading alot
This commit is contained in:
parent
72a7106fad
commit
b4ca1536b5
@ -13,19 +13,19 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage)
|
||||
bool update_games = false;
|
||||
bool update_homebrew = false;
|
||||
bool update_dml = false;
|
||||
bool update_emu = strcasestr(path.c_str(), m_plugin.getString("PLUGIN","romDir","").c_str()) != NULL;
|
||||
bool update_emu = false;
|
||||
|
||||
bool ditimes = false;
|
||||
bool music = typeid(T) == typeid(std::string);
|
||||
if(music)
|
||||
gprintf("Loading music list from path: %s\n",path.c_str());
|
||||
else if(update_emu)
|
||||
gprintf("Loading emulator gamelist from path: %s\n",path.c_str());
|
||||
else if(!m_wbfsFS)
|
||||
{
|
||||
gprintf("Database file: %s\n", m_database.c_str());
|
||||
|
||||
update_games = strcasestr(path.c_str(), "wbfs") != NULL && force_update[COVERFLOW_USB];
|
||||
update_homebrew = strcasestr(path.c_str(), "apps") != NULL && force_update[COVERFLOW_HOMEBREW];
|
||||
update_emu = strcasestr(path.c_str(), m_plugin.getString("PLUGIN","romDir","").c_str()) != NULL && force_update[COVERFLOW_EMU];
|
||||
|
||||
const char* partition = DeviceName[DeviceHandler::Instance()->PathToDriveType(path.c_str())];
|
||||
update_dml = strcasestr(path.c_str(), sfmt(strncmp(partition, "sd", 2) != 0 ? m_DMLgameDir.c_str() : "%s:/games", partition).c_str()) != NULL && force_update[COVERFLOW_DML];
|
||||
@ -74,7 +74,7 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage)
|
||||
if(update_homebrew) force_update[COVERFLOW_HOMEBREW] = false;
|
||||
if(update_dml) force_update[COVERFLOW_DML] = false;
|
||||
|
||||
if(m_update || m_wbfsFS || music || update_emu)
|
||||
if(m_update || m_wbfsFS || music)
|
||||
{
|
||||
gprintf("Calling list to update filelist\n");
|
||||
|
||||
@ -90,7 +90,7 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage)
|
||||
m_loaded = true;
|
||||
m_update = false;
|
||||
|
||||
if(!music && !update_emu && pathlist.size() > 0)
|
||||
if(!music && pathlist.size() > 0)
|
||||
{
|
||||
Save();
|
||||
pathlist.clear();
|
||||
|
@ -1957,17 +1957,22 @@ bool CMenu::_loadEmuList()
|
||||
m_plugin.load(fmt("%s/plugins.ini", m_pluginsDir.c_str()));
|
||||
pdir = opendir(m_pluginsDir.c_str());
|
||||
|
||||
safe_vector<dir_discHdr> emuList;
|
||||
|
||||
while ((pent = readdir(pdir)) != NULL)
|
||||
{
|
||||
// Skip it
|
||||
if (strcmp (pent->d_name, ".") == 0 || strcmp (pent->d_name, "..") == 0)
|
||||
if (strcmp(pent->d_name, ".") == 0 || strcmp(pent->d_name, "..") == 0 || strcasecmp(pent->d_name, "plugins.ini") == 0)
|
||||
continue;
|
||||
if(strcasestr(pent->d_name, ".ini") != NULL)
|
||||
{
|
||||
m_gameList.m_plugin.load(fmt("%s/%s", m_pluginsDir.c_str(), pent->d_name));
|
||||
if(m_gameList.m_plugin.loaded())
|
||||
{
|
||||
m_gameList.Load(sfmt("%s:/%s", DeviceName[currentPartition], m_gameList.m_plugin.getString("PLUGIN","romDir","").c_str()), m_gameList.m_plugin.getString("PLUGIN","fileTypes","").c_str(), "EN");
|
||||
m_gameList.clear();
|
||||
m_gameList.Load(sfmt("%s:/%s", DeviceName[currentPartition], m_gameList.m_plugin.getString("PLUGIN","romDir","").c_str()), m_gameList.m_plugin.getString("PLUGIN","fileTypes","").c_str(), m_cfg.getString("EMULATOR", "lastlanguage", "EN").c_str());
|
||||
for(safe_vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
||||
emuList.push_back(*tmp_itr);
|
||||
m_plugin.setString("GENERAL",m_gameList.m_plugin.getString("PLUGIN","magic","").c_str(),m_gameList.m_plugin.getString("PLUGIN","dolFile","").c_str());
|
||||
}
|
||||
m_gameList.m_plugin.unload();
|
||||
@ -1975,6 +1980,10 @@ bool CMenu::_loadEmuList()
|
||||
}
|
||||
closedir(pdir);
|
||||
m_plugin.save(true);
|
||||
m_gameList.clear();
|
||||
for(safe_vector<dir_discHdr>::iterator tmp_itr = emuList.begin(); tmp_itr != emuList.end(); tmp_itr++)
|
||||
m_gameList.push_back(*tmp_itr);
|
||||
emuList.clear();
|
||||
m_cfg.setString("EMULATOR", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
|
||||
m_cfg.save();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user