From e57c20e5d91ea8e595157e9c2471cf2939ed9537 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Thu, 8 Mar 2012 12:25:39 +0000 Subject: [PATCH] -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. --- source/list/cachedlist.cpp | 2 +- source/list/cachedlist.hpp | 4 +++- source/list/list.cpp | 7 ++++--- source/list/list.hpp | 2 +- source/menu/menu.cpp | 2 +- source/menu/menu_game.cpp | 2 +- source/menu/menu_wbfs.cpp | 2 +- source/music/musicplayer.cpp | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/source/list/cachedlist.cpp b/source/list/cachedlist.cpp index 84e0bbad..5e15d814 100644 --- a/source/list/cachedlist.cpp +++ b/source/list/cachedlist.cpp @@ -57,7 +57,7 @@ void CachedList::Load(string path, string containing, string m_lastLanguage) safe_vector 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"); diff --git a/source/list/cachedlist.hpp b/source/list/cachedlist.hpp index 07cb2761..a41d78c2 100644 --- a/source/list/cachedlist.hpp +++ b/source/list/cachedlist.hpp @@ -20,7 +20,7 @@ template class CachedList : public safe_vector { 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 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 string m_curLanguage; string m_lastLanguage; string m_discinf; + string m_DMLgameDir; }; #endif diff --git a/source/list/list.cpp b/source/list/list.cpp index 3f2e68ac..3069acf2 100644 --- a/source/list/list.cpp +++ b/source/list/list.cpp @@ -82,7 +82,7 @@ void CList::GetPaths(safe_vector &pathlist, string containing, string } template <> -void CList::GetHeaders(safe_vector pathlist, safe_vector &headerlist, string, string) +void CList::GetHeaders(safe_vector pathlist, safe_vector &headerlist, string, string, string) { //gprintf("Getting headers for CList\n"); @@ -94,7 +94,7 @@ void CList::GetHeaders(safe_vector pathlist, safe_vector } template <> -void CList::GetHeaders(safe_vector pathlist, safe_vector &headerlist, string settingsDir, string curLanguage) +void CList::GetHeaders(safe_vector pathlist, safe_vector &headerlist, string settingsDir, string curLanguage, string DMLgameUSBDir) { if(pathlist.size() < 1) return; headerlist.reserve(pathlist.size() + headerlist.size()); @@ -131,7 +131,8 @@ void CList::GetHeaders(safe_vector pathlist, safe_vectorPathToDriveType((*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 ) diff --git a/source/list/list.hpp b/source/list/list.hpp index a96ca3a9..d2ef02b8 100644 --- a/source/list/list.hpp +++ b/source/list/list.hpp @@ -24,7 +24,7 @@ class CList CList(){}; ~CList(){}; void GetPaths(safe_vector &pathlist, string containing, string directory, bool wbfs_fs = false); - void GetHeaders(safe_vector pathlist, safe_vector &headerlist, string, string); + void GetHeaders(safe_vector pathlist, safe_vector &headerlist, string, string, string); void GetChannels(safe_vector &headerlist, string, u32, string); private: void Check_For_ID(u8 *id, string path, string one, string two); diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 90bbc75a..12a54aae 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -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; diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index aee502f5..e7f2d052 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -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); diff --git a/source/menu/menu_wbfs.cpp b/source/menu/menu_wbfs.cpp index 0f6a2379..064c5bdc 100644 --- a/source/menu/menu_wbfs.cpp +++ b/source/menu/menu_wbfs.cpp @@ -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; } diff --git a/source/music/musicplayer.cpp b/source/music/musicplayer.cpp index a48f1a41..d679c3d9 100644 --- a/source/music/musicplayer.cpp +++ b/source/music/musicplayer.cpp @@ -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");