- fix for channels video modes broken in 5.5.0

- now always use coverfolder for plugins
- v5.5.1
This commit is contained in:
Fledge68 2022-01-14 15:10:56 -06:00
parent 8b2bacf223
commit 105a1bc623
11 changed files with 99 additions and 114 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -97,24 +97,24 @@ int main()
Hermes_shadow_mload(); Hermes_shadow_mload();
} }
prog(20); prog(20);
Disc_Open(normalCFG.GameBootType); Disc_Open(normalCFG.GameBootType);// sets Disc_ID
u32 offset = 0; u32 offset = 0;
Disc_FindPartition(&offset); Disc_FindPartition(&offset);
WDVD_OpenPartition(offset, &GameIOS); WDVD_OpenPartition(offset, &GameIOS);
Disc_SetLowMem(); Disc_SetLowMem();
if(normalCFG.vidMode == 5) if(normalCFG.vidMode == 5)
normalCFG.patchVidMode = 1; //progressive mode requires this normalCFG.patchVidMode = 1; //progressive mode requires this
vmode = Disc_SelectVMode(normalCFG.vidMode, &vmode_reg); vmode = Disc_SelectVMode(normalCFG.vidMode, &vmode_reg);// requires Disc_ID[3]
AppEntrypoint = Apploader_Run(normalCFG.vidMode, vmode, normalCFG.vipatch, normalCFG.countryString, normalCFG.patchVidMode, normalCFG.aspectRatio, AppEntrypoint = Apploader_Run(normalCFG.vidMode, vmode, normalCFG.vipatch, normalCFG.countryString, normalCFG.patchVidMode, normalCFG.aspectRatio,
normalCFG.returnTo, normalCFG.patchregion, normalCFG.private_server, normalCFG.server_addr, normalCFG.patchFix480p, normalCFG.deflicker, normalCFG.BootType); normalCFG.returnTo, normalCFG.patchregion, normalCFG.private_server, normalCFG.server_addr, normalCFG.patchFix480p, normalCFG.deflicker, normalCFG.BootType);
WDVD_Close(); WDVD_Close();
} }
else if(normalCFG.BootType == TYPE_CHANNEL) else if(normalCFG.BootType == TYPE_CHANNEL)
{ {
vmode = Disc_SelectVMode(normalCFG.vidMode, &vmode_reg);
ISFS_Initialize(); ISFS_Initialize();
AppEntrypoint = LoadChannel(normalCFG.title, normalCFG.use_dol, &GameIOS); AppEntrypoint = LoadChannel(normalCFG.title, normalCFG.use_dol, &GameIOS);// sets Disc_ID
ISFS_Deinitialize(); ISFS_Deinitialize();
vmode = Disc_SelectVMode(normalCFG.vidMode, &vmode_reg);// requires Disc_ID[3]
PatchChannel(normalCFG.vidMode, vmode, normalCFG.vipatch, normalCFG.countryString, normalCFG.patchVidMode, normalCFG.aspectRatio, PatchChannel(normalCFG.vidMode, vmode, normalCFG.vipatch, normalCFG.countryString, normalCFG.patchVidMode, normalCFG.aspectRatio,
normalCFG.returnTo, normalCFG.private_server, normalCFG.server_addr, normalCFG.patchFix480p, normalCFG.deflicker, normalCFG.BootType); normalCFG.returnTo, normalCFG.private_server, normalCFG.server_addr, normalCFG.patchFix480p, normalCFG.deflicker, normalCFG.BootType);
} }

View File

@ -1,6 +1,6 @@
#define APP_NAME "WiiFlow WFL" #define APP_NAME "WiiFlow WFL"
#define APP_VERSION "5.5.0" #define APP_VERSION "5.5.1"
#define APP_DATA_DIR "wiiflow" #define APP_DATA_DIR "wiiflow"
#define APPS_DIR "apps/wiiflow" #define APPS_DIR "apps/wiiflow"

View File

@ -125,7 +125,7 @@ bool PartitionHandle::Mount(int pos, const char *name, bool forceFAT)
if(valid(pos)) if(valid(pos))
UnMount(pos); UnMount(pos);
if(!name) if(!name || strlen(name) > 8)
return false; return false;
if(pos >= (int)MountNameList.size()) if(pos >= (int)MountNameList.size())
@ -133,9 +133,8 @@ bool PartitionHandle::Mount(int pos, const char *name, bool forceFAT)
MountNameList[pos] = name; MountNameList[pos] = name;
char DeviceSyn[10]; char DeviceSyn[10];
memcpy(DeviceSyn, name, 8); strcpy(DeviceSyn, name);
strcat(DeviceSyn, ":"); strcat(DeviceSyn, ":");
DeviceSyn[9] = '\0';
//! Some stupid partition manager think they don't need to edit the freaken MBR. //! Some stupid partition manager think they don't need to edit the freaken MBR.
//! So we need to check the first 64 sectors and see if some partition is there. //! So we need to check the first 64 sectors and see if some partition is there.

View File

@ -204,7 +204,6 @@ CCoverFlow::CCoverFlow(void)
m_compressTextures = true; m_compressTextures = true;
m_compressCache = false; m_compressCache = false;
m_deletePicsAfterCaching = false; m_deletePicsAfterCaching = false;
m_pluginCacheFolders = false;
m_box = true; m_box = true;
m_smallBox = false; m_smallBox = false;
m_useHQcover = false; m_useHQcover = false;
@ -263,10 +262,9 @@ CCoverFlow::~CCoverFlow(void)
LWP_MutexDestroy(m_mutex); LWP_MutexDestroy(m_mutex);
} }
void CCoverFlow::setCachePath(const char *path, bool pluginCacheFolders) void CCoverFlow::setCachePath(const char *path)
{ {
m_cachePath = path; m_cachePath = path;
m_pluginCacheFolders = pluginCacheFolders;
} }
void CCoverFlow::setTextureQuality(float lodBias, int aniso, bool edgeLOD) void CCoverFlow::setTextureQuality(float lodBias, int aniso, bool edgeLOD)
@ -2769,7 +2767,7 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
strncpy(wfcTitle, fmt("%s", getFilenameId(m_items[i].hdr)), sizeof(wfcTitle) - 1); strncpy(wfcTitle, fmt("%s", getFilenameId(m_items[i].hdr)), sizeof(wfcTitle) - 1);
/* get coverfolder for plugins, sourceflow, and homebrew */ /* get coverfolder for plugins, sourceflow, and homebrew */
if(m_items[i].hdr->type == TYPE_PLUGIN && m_pluginCacheFolders) if(m_items[i].hdr->type == TYPE_PLUGIN)
wfcCoverDir = m_plugin.GetCoverFolderName(m_items[i].hdr->settings[0]); wfcCoverDir = m_plugin.GetCoverFolderName(m_items[i].hdr->settings[0]);
if(m_items[i].hdr->type == TYPE_SOURCE) if(m_items[i].hdr->type == TYPE_SOURCE)
wfcCoverDir = "sourceflow"; wfcCoverDir = "sourceflow";
@ -2782,7 +2780,17 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
if(m_smallBox) if(m_smallBox)
strncpy(full_path, fmt("%s/%s/%s_small.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH); strncpy(full_path, fmt("%s/%s/%s_small.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH);
else else
{
strncpy(full_path, fmt("%s/%s/%s.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH); strncpy(full_path, fmt("%s/%s/%s.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH);
/*if(!fsop_FileExist(full_path))
{
if(strrchr(wfcTitle, '.') != NULL)
{
*strrchr(wfcTitle, '.') = '\0';
strncpy(full_path, fmt("%s/%s/%s.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH);
}
}*/
}
} }
else else
{ {

View File

@ -126,7 +126,7 @@ public:
void stopSound(void); void stopSound(void);
// //
void applySettings(void); void applySettings(void);
void setCachePath(const char *path, bool pluginCacheFolders); void setCachePath(const char *path);
bool fullCoverCached(const char *wfcPath); bool fullCoverCached(const char *wfcPath);
bool cacheCoverBuffer(const char *wfcPath, const u8 *png, bool full); bool cacheCoverBuffer(const char *wfcPath, const u8 *png, bool full);
bool cacheCoverFile(const char *wfcPath, const char *coverPath, bool full); bool cacheCoverFile(const char *wfcPath, const char *coverPath, bool full);
@ -289,7 +289,6 @@ private:
bool m_compressCache; bool m_compressCache;
std::string m_cachePath; std::string m_cachePath;
bool m_deletePicsAfterCaching; bool m_deletePicsAfterCaching;
bool m_pluginCacheFolders;
bool m_mirrorBlur; bool m_mirrorBlur;
float m_mirrorAlpha; float m_mirrorAlpha;
float m_txtMirrorAlpha; float m_txtMirrorAlpha;

View File

@ -670,7 +670,7 @@ void CMenu::_loadCFCfg()
const char *domain = "_COVERFLOW"; const char *domain = "_COVERFLOW";
//gprintf("Preparing to load sounds from %s\n", m_themeDataDir.c_str()); //gprintf("Preparing to load sounds from %s\n", m_themeDataDir.c_str());
CoverFlow.setCachePath(m_cacheDir.c_str(), m_cfg.getBool(PLUGIN_DOMAIN, "subfolder_cache", true)); CoverFlow.setCachePath(m_cacheDir.c_str());
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20)); CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
// Coverflow Sounds // Coverflow Sounds
CoverFlow.setSounds( CoverFlow.setSounds(
@ -2633,7 +2633,7 @@ bool CMenu::_loadPluginList()
void CMenu::_stopSounds(void) void CMenu::_stopSounds(void)
{ {
// Fade out sounds // Fade out sounds
int fade_rate = m_cfg.getInt("GENERAL", "music_fade_rate", 8); int fade_rate = 20;
if(!MusicPlayer.IsStopped()) if(!MusicPlayer.IsStopped())
{ {
@ -2885,14 +2885,14 @@ const char *CMenu::getBoxPath(const dir_discHdr *element)
{ {
if(element->type == TYPE_PLUGIN) if(element->type == TYPE_PLUGIN)
{ {
const char *tempname = element->path; const char *filename = fmt("%s", element->path);
if(strchr(element->path, '/') != NULL) if(strchr(filename, '/') != NULL)
tempname = strrchr(element->path, '/') + 1; {
filename = fmt("%s", strrchr(element->path, '/') + 1);
}
const char *coverFolder = m_plugin.GetCoverFolderName(element->settings[0]); const char *coverFolder = m_plugin.GetCoverFolderName(element->settings[0]);
if(strlen(coverFolder) > 0) return fmt("%s/%s/%s.png", m_boxPicDir.c_str(), coverFolder, filename);
return fmt("%s/%s/%s.png", m_boxPicDir.c_str(), coverFolder, tempname);
else
return fmt("%s/%s.png", m_boxPicDir.c_str(), tempname);
} }
else if(element->type == TYPE_HOMEBREW)// use folder name for the png name else if(element->type == TYPE_HOMEBREW)// use folder name for the png name
return fmt("%s/homebrew/%s.png", m_boxPicDir.c_str(), strrchr(element->path, '/') + 1); return fmt("%s/homebrew/%s.png", m_boxPicDir.c_str(), strrchr(element->path, '/') + 1);

View File

@ -41,7 +41,7 @@ void CMenu::_extractBnr(const dir_discHdr *hdr)
void CMenu::_setCurrentItem(const dir_discHdr *hdr) void CMenu::_setCurrentItem(const dir_discHdr *hdr)
{ {
const char *title = CoverFlow.getFilenameId(hdr); const char *fn_id = CoverFlow.getFilenameId(hdr);
if(m_current_view == COVERFLOW_PLUGIN) if(m_current_view == COVERFLOW_PLUGIN)
{ {
if(hdr->type == TYPE_PLUGIN) if(hdr->type == TYPE_PLUGIN)
@ -60,11 +60,11 @@ void CMenu::_setCurrentItem(const dir_discHdr *hdr)
strncpy(m_plugin.PluginMagicWord, "48425257", 9); strncpy(m_plugin.PluginMagicWord, "48425257", 9);
} }
m_cfg.setString(PLUGIN_DOMAIN, "cur_magic", m_plugin.PluginMagicWord); m_cfg.setString(PLUGIN_DOMAIN, "cur_magic", m_plugin.PluginMagicWord);
m_cfg.setString("plugin_item", m_plugin.PluginMagicWord, title); m_cfg.setString("plugin_item", m_plugin.PluginMagicWord, fn_id);
} }
else else
{ {
m_cfg.setString(_domainFromView(), "current_item", title); m_cfg.setString(_domainFromView(), "current_item", fn_id);
if(m_source_cnt > 1) if(m_source_cnt > 1)
m_cfg.setInt("MULTI", "current_item_type", hdr->type); m_cfg.setInt("MULTI", "current_item_type", hdr->type);
} }
@ -100,16 +100,16 @@ void CMenu::_hideGame(bool instant)
void CMenu::_showGame(void) void CMenu::_showGame(void)
{ {
const dir_discHdr *GameHdr = CoverFlow.getHdr(); const dir_discHdr *GameHdr = CoverFlow.getHdr();
const char *coverDir = NULL;
const char *FanartPath = NULL; const char *FanartPath = NULL;
if(GameHdr->type == TYPE_PLUGIN)
coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]);
if(coverDir == NULL || strlen(coverDir) == 0) /* set fanart path */
FanartPath = fmt("%s", m_fanartDir.c_str()); if(GameHdr->type == TYPE_PLUGIN)
FanartPath = fmt("%s/%s", m_fanartDir.c_str(), m_plugin.GetCoverFolderName(GameHdr->settings[0]));
else else
FanartPath = fmt("%s/%s", m_fanartDir.c_str(), coverDir); FanartPath = fmt("%s", m_fanartDir.c_str());
if(m_fa.load(m_cfg, FanartPath, CoverFlow.getHdr()))
/* Load fanart config if available */
if(m_fa.load(m_cfg, FanartPath, GameHdr))
{ {
const TexData *bg = NULL; const TexData *bg = NULL;
const TexData *bglq = NULL; const TexData *bglq = NULL;
@ -117,7 +117,7 @@ void CMenu::_showGame(void)
_setBg(*bg, *bglq); _setBg(*bg, *bglq);
CoverFlow.hideCover(); CoverFlow.hideCover();
} }
else else // no fanart config so we show the cover and game menu background
{ {
CoverFlow.showCover(); CoverFlow.showCover();
if(customBg) if(customBg)
@ -143,57 +143,39 @@ void CMenu::_cleanupVideo()
movie.DeInit(); movie.DeInit();
} }
static const char *getVideoPath(const string &videoDir, const char *videoId)
{
const char *coverDir = NULL;
const char *videoPath = NULL;
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
coverDir = m_plugin.GetCoverFolderName(CoverFlow.getHdr()->settings[0]);
if(coverDir == NULL || strlen(coverDir) == 0)
videoPath = fmt("%s/%s", videoDir.c_str(), videoId);
else
videoPath = fmt("%s/%s/%s", videoDir.c_str(), coverDir, videoId);
return videoPath;
}
static const char *getVideoDefaultPath(const string &videoDir)
{
//strncpy(m_plugin.PluginMagicWord, fmt("%08x", CoverFlow.getHdr()->settings[0]), 8);
const char *videoPath = fmt("%s/%s", videoDir.c_str(), m_plugin.PluginMagicWord);
return videoPath;
}
bool CMenu::_startVideo() bool CMenu::_startVideo()
{ {
const dir_discHdr *GameHdr = CoverFlow.getHdr(); const dir_discHdr *GameHdr = CoverFlow.getHdr();
const char *videoPath = NULL;
const char *THP_Path = NULL;
const char *videoId = NULL; if(GameHdr->type == TYPE_PLUGIN)
char curId3[4]; {
memset(curId3, 0, 4); const char *fn = CoverFlow.getFilenameId(GameHdr);//title.ext
if(!NoGameID(GameHdr->type)) const char *coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]);
{ //id3 videoPath = fmt("%s/%s/%s", m_videoDir.c_str(), coverDir, fn);
memcpy(curId3, GameHdr->id, 3); THP_Path = fmt("%s.thp", videoPath);
videoId = curId3; if(!fsop_FileExist(THP_Path))
{
if(strrchr(videoPath, '.') != NULL)
{
*strrchr(videoPath, '.') = '\0';
THP_Path = fmt("%s.thp", videoPath);
}
if(!fsop_FileExist(THP_Path))//default video for all games of this plugin
{
videoPath = fmt("%s/%s", m_videoDir.c_str(), m_plugin.PluginMagicWord);// use magic number as the filename
THP_Path = fmt("%s.thp", videoPath);
}
}
} }
else else
videoId = CoverFlow.getFilenameId(GameHdr);//title.ext
//dev:/wiiflow/trailers/{coverfolder}/title.ext.thp or dev:/wiiflow/trailers/id3.thp
const char *videoPath = getVideoPath(m_videoDir, videoId);
const char *THP_Path = fmt("%s.thp", videoPath);
if(!fsop_FileExist(THP_Path))
{ {
if(GameHdr->type == TYPE_PLUGIN) videoPath = fmt("%s/%s.3", m_videoDir.c_str(), GameHdr->id);// try id3 first
THP_Path = fmt("%s.thp", videoPath);
if(!fsop_FileExist(THP_Path))
{ {
//dev:/wiiflow/trailers/magic#.thp videoPath = fmt("%s/%s", m_videoDir.c_str(), GameHdr->id);
videoPath = getVideoDefaultPath(m_videoDir);
THP_Path = fmt("%s.thp", videoPath);
}
else if(!NoGameID(GameHdr->type))
{
//id6
videoPath = getVideoPath(m_videoDir, GameHdr->id);
THP_Path = fmt("%s.thp", videoPath); THP_Path = fmt("%s.thp", videoPath);
} }
} }
@ -880,27 +862,31 @@ void * CMenu::_gameSoundThread(void *obj)
char cached_banner[256]; char cached_banner[256];
cached_banner[255] = '\0'; cached_banner[255] = '\0';
/* plugin individual game sound */
char game_sound[256];
game_sound[255] = '\0';
const dir_discHdr *GameHdr = CoverFlow.getHdr(); const dir_discHdr *GameHdr = CoverFlow.getHdr();
if(GameHdr->type == TYPE_PLUGIN) if(GameHdr->type == TYPE_PLUGIN)
{ {
const char *coverDir = NULL; char game_sound[256];
coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]); game_sound[255] = '\0';
char fileNameFull[128];
fileNameFull[127] = '\0';
char fileName[128];
fileName[127] = '\0';
strncpy(fileNameFull, CoverFlow.getFilenameId(GameHdr), sizeof(fileNameFull) - 1);
strcpy(fileName, fileNameFull);
if(strrchr(fileName, '.') != NULL)
*strrchr(fileName, '.') = '\0';// remove .ext
if(coverDir == NULL || strlen(coverDir) == 0) const char *coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]);
{
strncpy(custom_banner, fmt("%s/%s.bnr", m->m_customBnrDir.c_str(), CoverFlow.getFilenameId(GameHdr)), 255); strncpy(custom_banner, fmt("%s/%s/%s.bnr", m->m_customBnrDir.c_str(), coverDir, fileNameFull), sizeof(custom_banner) - 1);
strncpy(game_sound, fmt("%s/gamesounds/%s", m->m_dataDir.c_str(), CoverFlow.getFilenameId(GameHdr)), 251);//save for .ext if(!fsop_FileExist(custom_banner))
} strncpy(custom_banner, fmt("%s/%s/%s.bnr", m->m_customBnrDir.c_str(), coverDir, fileName), sizeof(custom_banner) - 1);
else
{ strncpy(game_sound, fmt("%s/gamesounds/%s/%s", m->m_dataDir.c_str(), coverDir, fileNameFull), sizeof(game_sound) - 1);
strncpy(custom_banner, fmt("%s/%s/%s.bnr", m->m_customBnrDir.c_str(), coverDir, CoverFlow.getFilenameId(GameHdr)), 255); if(!fsop_FileExist(game_sound))
strncpy(game_sound, fmt("%s/gamesounds/%s/%s", m->m_dataDir.c_str(), coverDir, CoverFlow.getFilenameId(GameHdr)), 251); strncpy(game_sound, fmt("%s/gamesounds/%s/%s", m->m_dataDir.c_str(), coverDir, fileName), sizeof(game_sound) - 1);
}
/* get plugin rom custom banner */ /* get plugin rom custom banner */
fsop_GetFileSizeBytes(custom_banner, &custom_bnr_size); fsop_GetFileSizeBytes(custom_banner, &custom_bnr_size);
@ -916,17 +902,16 @@ void * CMenu::_gameSoundThread(void *obj)
/* if no banner try getting snap shot */ /* if no banner try getting snap shot */
if((custom_bnr_size == 0 || custom_bnr_file == NULL) && m->m_platform.loaded()) if((custom_bnr_size == 0 || custom_bnr_file == NULL) && m->m_platform.loaded())
{ {
gprintf("trying to get snapshot\n"); //gprintf("trying to get snapshot\n");
m_banner.DeleteBanner(); m_banner.DeleteBanner();
char GameID[7]; char GameID[7];
GameID[6] = '\0'; char platformName[16];
char platformName[264];
const char *TMP_Char = NULL; const char *TMP_Char = NULL;
GameTDB gametdb; GameTDB gametdb;
strncpy(m_plugin.PluginMagicWord, fmt("%08x", GameHdr->settings[0]), 8); strncpy(m_plugin.PluginMagicWord, fmt("%08x", GameHdr->settings[0]), 8);
snprintf(platformName, sizeof(platformName), "%s", m->m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str()); snprintf(platformName, sizeof(platformName), "%s", m->m_platform.getString("PLUGINS", m_plugin.PluginMagicWord, "").c_str());
strcpy(GameID, GameHdr->id); strcpy(GameID, GameHdr->id);// GameHdr->id is null terminated
if(strlen(platformName) != 0 && strcasecmp(GameID, "PLUGIN") != 0) if(strlen(platformName) != 0 && strcasecmp(GameID, "PLUGIN") != 0)
{ {
@ -949,8 +934,8 @@ void * CMenu::_gameSoundThread(void *obj)
else else
{ {
char title[64]; char title[64];
wcstombs(title, GameHdr->title, 63);
title[63] = '\0'; title[63] = '\0';
wcstombs(title, GameHdr->title, sizeof(title) - 1);
ShortName = title; ShortName = title;
} }
@ -1009,11 +994,7 @@ void * CMenu::_gameSoundThread(void *obj)
TexHandle.Cleanup(m->m_game_snap); TexHandle.Cleanup(m->m_game_snap);
TexHandle.Cleanup(m->m_game_overlay); TexHandle.Cleanup(m->m_game_overlay);
} }
}
if(custom_bnr_size == 0 || custom_bnr_file == NULL)
{
/* try to get plugin rom gamesound or just the default plugin gamesound */ /* try to get plugin rom gamesound or just the default plugin gamesound */
m_banner.DeleteBanner();
bool found = false; bool found = false;
if(fsop_FileExist(fmt("%s.mp3", game_sound))) if(fsop_FileExist(fmt("%s.mp3", game_sound)))
{ {
@ -1040,9 +1021,6 @@ void * CMenu::_gameSoundThread(void *obj)
m->m_gameSound.Load(m_plugin.GetBannerSound(GameHdr->settings[0]), m_plugin.GetBannerSoundSize()); m->m_gameSound.Load(m_plugin.GetBannerSound(GameHdr->settings[0]), m_plugin.GetBannerSoundSize());
if(m->m_gameSound.IsLoaded()) if(m->m_gameSound.IsLoaded())
m->m_gamesound_changed = true; m->m_gamesound_changed = true;
}
if(custom_bnr_size == 0 || custom_bnr_file == NULL)// no custom banner so we are done. exit sound thread.
{
m->m_soundThrdBusy = false; m->m_soundThrdBusy = false;
return NULL; return NULL;
} }

View File

@ -524,7 +524,6 @@ int CMenu::_sfCacheCoversNeeded()// for sourceflow
int CMenu::_cacheCovers() int CMenu::_cacheCovers()
{ {
CoverFlow.stopCoverLoader(true); CoverFlow.stopCoverLoader(true);
bool m_pluginCacheFolders = m_cfg.getBool(PLUGIN_DOMAIN, "subfolder_cache", true);
char coverPath[MAX_FAT_PATH];//1024 char coverPath[MAX_FAT_PATH];//1024
char wfcPath[MAX_FAT_PATH+20]; char wfcPath[MAX_FAT_PATH+20];
@ -574,7 +573,7 @@ int CMenu::_cacheCovers()
} }
/* get cache folder path */ /* get cache folder path */
if(hdr->type == TYPE_PLUGIN && m_pluginCacheFolders) if(hdr->type == TYPE_PLUGIN)
snprintf(cachePath, sizeof(cachePath), "%s/%s", m_cacheDir.c_str(), m_plugin.GetCoverFolderName(hdr->settings[0])); snprintf(cachePath, sizeof(cachePath), "%s/%s", m_cacheDir.c_str(), m_plugin.GetCoverFolderName(hdr->settings[0]));
else if(m_sourceflow) else if(m_sourceflow)
snprintf(cachePath, sizeof(cachePath), "%s/sourceflow", m_cacheDir.c_str()); snprintf(cachePath, sizeof(cachePath), "%s/sourceflow", m_cacheDir.c_str());

View File

@ -70,13 +70,12 @@ void Plugin::init(const string& m_pluginsDir)
continue; continue;
m_plugin_cfg.load(iniFile->c_str()); m_plugin_cfg.load(iniFile->c_str());
if(m_plugin_cfg.loaded() && Plugins.size() < 255)// max plugins count = 255 if(m_plugin_cfg.loaded() && Plugins.size() < 255)// max plugins count = 255
{
m_plugin.AddPlugin(m_plugin_cfg, *iniFile); m_plugin.AddPlugin(m_plugin_cfg, *iniFile);
}
m_plugin_cfg.unload(); m_plugin_cfg.unload();
} }
std::sort(Plugins.begin(), Plugins.end(), PluginOptions_cmp);
} }
std::sort(Plugins.begin(), Plugins.end(), PluginOptions_cmp);
} }
void Plugin::Cleanup() void Plugin::Cleanup()
@ -87,11 +86,14 @@ void Plugin::Cleanup()
void Plugin::AddPlugin(Config &plugin, const string &iniPath) void Plugin::AddPlugin(Config &plugin, const string &iniPath)
{ {
PluginOptions NewPlugin; PluginOptions NewPlugin;
string magic = plugin.getString(PLUGIN, "magic", "");
if(magic.empty())// no magic number don't add to list.
return;
NewPlugin.path = iniPath; NewPlugin.path = iniPath;
NewPlugin.DolName = plugin.getString(PLUGIN, "dolFile"); NewPlugin.DolName = plugin.getString(PLUGIN, "dolFile");
NewPlugin.coverFolder = plugin.getString(PLUGIN, "coverFolder"); NewPlugin.coverFolder = plugin.getString(PLUGIN, "coverFolder", magic);// no coverfolder use magic as folder name
NewPlugin.magic = strtoul(plugin.getString(PLUGIN, "magic").c_str(), NULL, 16); NewPlugin.magic = strtoul(magic.c_str(), NULL, 16);
NewPlugin.caseColor = strtoul(plugin.getString(PLUGIN, "coverColor").c_str(), NULL, 16); NewPlugin.caseColor = strtoul(plugin.getString(PLUGIN, "coverColor", "000000").c_str(), NULL, 16);
NewPlugin.romPartition = plugin.getInt(PLUGIN, "rompartition", -1); NewPlugin.romPartition = plugin.getInt(PLUGIN, "rompartition", -1);
NewPlugin.romDir = plugin.getString(PLUGIN, "romDir"); NewPlugin.romDir = plugin.getString(PLUGIN, "romDir");
NewPlugin.fileTypes = plugin.getString(PLUGIN, "fileTypes"); NewPlugin.fileTypes = plugin.getString(PLUGIN, "fileTypes");