-changed a few things about addition from r183 again,

now it should work better, please also make sure you
delete the wiiflow/cache folder before trying this rev.
This commit is contained in:
fix94.1 2012-03-08 12:25:39 +00:00
parent 63dbed3f68
commit e57c20e5d9
8 changed files with 13 additions and 10 deletions

View File

@ -57,7 +57,7 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage)
safe_vector<string> pathlist;
list.GetPaths(pathlist, containing, path, m_wbfsFS);
list.GetHeaders(pathlist, *this, m_settingsDir, m_curLanguage);
list.GetHeaders(pathlist, *this, m_settingsDir, m_curLanguage, m_DMLgameDir);
path.append("/touch.db");
FILE *file = fopen(path.c_str(), "wb");

View File

@ -20,7 +20,7 @@ template <typename T = dir_discHdr>
class CachedList : public safe_vector<T>
{
public:
void Init(string cachedir, string settingsDir, string curLanguage) /* Initialize Private Variables */
void Init(string cachedir, string settingsDir, string curLanguage, string DMLgameDir) /* Initialize Private Variables */
{
m_cacheDir = cachedir;
m_settingsDir = settingsDir;
@ -28,6 +28,7 @@ class CachedList : public safe_vector<T>
m_loaded = false;
m_database = "";
m_update = false;
m_DMLgameDir = DMLgameDir;
for(u32 i = 0; i < COVERFLOW_MAX; i++)
force_update[i] = false;
}
@ -74,6 +75,7 @@ class CachedList : public safe_vector<T>
string m_curLanguage;
string m_lastLanguage;
string m_discinf;
string m_DMLgameDir;
};
#endif

View File

@ -82,7 +82,7 @@ void CList<T>::GetPaths(safe_vector<string> &pathlist, string containing, string
}
template <>
void CList<string>::GetHeaders(safe_vector<string> pathlist, safe_vector<string> &headerlist, string, string)
void CList<string>::GetHeaders(safe_vector<string> pathlist, safe_vector<string> &headerlist, string, string, string)
{
//gprintf("Getting headers for CList<string>\n");
@ -94,7 +94,7 @@ void CList<string>::GetHeaders(safe_vector<string> pathlist, safe_vector<string>
}
template <>
void CList<dir_discHdr>::GetHeaders(safe_vector<string> pathlist, safe_vector<dir_discHdr> &headerlist, string settingsDir, string curLanguage)
void CList<dir_discHdr>::GetHeaders(safe_vector<string> pathlist, safe_vector<dir_discHdr> &headerlist, string settingsDir, string curLanguage, string DMLgameUSBDir)
{
if(pathlist.size() < 1) return;
headerlist.reserve(pathlist.size() + headerlist.size());
@ -131,7 +131,8 @@ void CList<dir_discHdr>::GetHeaders(safe_vector<string> pathlist, safe_vector<di
if (wbfs || (*itr).rfind(".iso") != string::npos || (*itr).rfind(".ISO") != string::npos)
{
char* filename = &(*itr)[(*itr).find_last_of('/')+1];
if(strcasecmp(filename, "game.iso") == 0 && strstr((*itr).c_str(), ":/games/") != NULL)
const char* dml_partition = DeviceName[DeviceHandler::Instance()->PathToDriveType((*itr).c_str())];
if(strcasecmp(filename, "game.iso") == 0 && strstr((*itr).c_str(), sfmt((strncmp(dml_partition, "sd", 2) != 0) ? DMLgameUSBDir.c_str() : DML_DIR, dml_partition).c_str()) != NULL)
{
FILE *fp = fopen((*itr).c_str(), "rb");
if( fp )

View File

@ -24,7 +24,7 @@ class CList
CList(){};
~CList(){};
void GetPaths(safe_vector<string> &pathlist, string containing, string directory, bool wbfs_fs = false);
void GetHeaders(safe_vector<string> pathlist, safe_vector<T> &headerlist, string, string);
void GetHeaders(safe_vector<string> pathlist, safe_vector<T> &headerlist, string, string, string);
void GetChannels(safe_vector<T> &headerlist, string, u32, string);
private:
void Check_For_ID(u8 *id, string path, string one, string two);

View File

@ -373,7 +373,7 @@ void CMenu::init(void)
m_loc.load(sfmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()).c_str());
}
m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"), m_DMLgameDir);
m_aa = 3;

View File

@ -588,7 +588,7 @@ void CMenu::_directlaunch(const string &id)
strncasecmp(DeviceHandler::Instance()->PathToFSName(path.c_str()), "WBFS", 4) == 0);
m_gameList.clear();
list.GetHeaders(pathlist, m_gameList, m_settingsDir, m_curLanguage);
list.GetHeaders(pathlist, m_gameList, m_settingsDir, m_curLanguage, m_DMLgameDir);
if(m_gameList.size() > 0)
{
gprintf("Game found on partition #%i\n", i);

View File

@ -377,7 +377,7 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
else
{
char source[300];
snprintf(source, sizeof(source), "%s", sfmt((char *)m_cf.getHdr()->path, DeviceName[currentPartition]).c_str());
snprintf(source, sizeof(source), "%s/%s", sfmt((currentPartition != SD) ? m_DMLgameDir.c_str() : DML_DIR, DeviceName[currentPartition]).c_str(), (char *)m_cf.getHdr()->path);
fsop_deleteFolder(source);
upd_dml = true;
}

View File

@ -31,7 +31,7 @@ void MusicPlayer::Init(Config &cfg, string musicDir, string themeMusicDir)
SetVolume(0); // Fades in with tick()
MusicDirectory dir = (MusicDirectory) cfg.getInt("GENERAL", "music_directories", NORMAL_MUSIC | THEME_MUSIC);
m_music_files.Init(cfg.getString("GENERAL", "dir_list_cache"), std::string(), std::string());
m_music_files.Init(cfg.getString("GENERAL", "dir_list_cache"), std::string(), std::string(), std::string());
if (dir & THEME_MUSIC)
m_music_files.Load(themeMusicDir, ".ogg|.mp3", "EN"); //|.mod|.xm|.s3m|.wav|.aiff");