mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2025-01-11 19:39:09 +01:00
-added optional gamesound for each plugin rom/game. they must be mp3, wav, or ogg. put them in wiiflow/gamesounds/{coverfolder} with same name as the game including the extension. example:
sd:/wiiflow/gamesounds/snes9x/donkey kong country.zip.mp3
This commit is contained in:
parent
f1398ea406
commit
b93ace2b6b
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -295,28 +295,31 @@ void CMenu::_hideGame(bool instant)
|
|||||||
void CMenu::_showGame(void)
|
void CMenu::_showGame(void)
|
||||||
{
|
{
|
||||||
CoverFlow.showCover();
|
CoverFlow.showCover();
|
||||||
|
|
||||||
|
const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
||||||
const char *coverDir = NULL;
|
const char *coverDir = NULL;
|
||||||
const char *Path = NULL;
|
const char *Path = NULL;
|
||||||
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
|
if(GameHdr->type == TYPE_PLUGIN)
|
||||||
coverDir = m_plugin.GetCoverFolderName(CoverFlow.getHdr()->settings[0]);
|
coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]);
|
||||||
|
|
||||||
if(coverDir == NULL || strlen(coverDir) == 0)
|
if(coverDir == NULL || strlen(coverDir) == 0)
|
||||||
Path = fmt("%s", m_fanartDir.c_str());
|
Path = fmt("%s", m_fanartDir.c_str());
|
||||||
else
|
else
|
||||||
Path = fmt("%s/%s", m_fanartDir.c_str(), coverDir);
|
Path = fmt("%s/%s", m_fanartDir.c_str(), coverDir);
|
||||||
if(m_fa.load(m_cfg, Path, CoverFlow.getFilenameId(CoverFlow.getHdr(), false), CoverFlow.getHdr()->type == TYPE_PLUGIN))
|
if(m_fa.load(m_cfg, Path, CoverFlow.getFilenameId(GameHdr, false), GameHdr->type == TYPE_PLUGIN))
|
||||||
{
|
{
|
||||||
const TexData *bg = NULL;
|
const TexData *bg = NULL;
|
||||||
const TexData *bglq = NULL;
|
const TexData *bglq = NULL;
|
||||||
m_fa.getBackground(bg, bglq);
|
m_fa.getBackground(bg, bglq);
|
||||||
if(bg != NULL && bglq != NULL)
|
if(bg != NULL && bglq != NULL)
|
||||||
_setBg(*bg, *bglq);
|
_setBg(*bg, *bglq);
|
||||||
if (m_fa.hideCover())
|
if(m_fa.hideCover())
|
||||||
CoverFlow.hideCover();
|
CoverFlow.hideCover();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_setBg(m_gameBg, m_gameBgLQ);
|
_setBg(m_gameBg, m_gameBgLQ);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!m_zoom_banner)
|
if(!m_zoom_banner)
|
||||||
{
|
{
|
||||||
for(u8 i = 0; i < ARRAY_SIZE(m_gameLblUser) - 1; ++i)
|
for(u8 i = 0; i < ARRAY_SIZE(m_gameLblUser) - 1; ++i)
|
||||||
@ -2094,6 +2097,8 @@ void * CMenu::_gameSoundThread(void *obj)
|
|||||||
u32 cached_bnr_size = 0;
|
u32 cached_bnr_size = 0;
|
||||||
char cached_banner[256];
|
char cached_banner[256];
|
||||||
cached_banner[255] = '\0';
|
cached_banner[255] = '\0';
|
||||||
|
char game_sound[256];
|
||||||
|
game_sound[255] = '\0';
|
||||||
|
|
||||||
m_banner_loaded = false;
|
m_banner_loaded = false;
|
||||||
const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
||||||
@ -2103,9 +2108,17 @@ void * CMenu::_gameSoundThread(void *obj)
|
|||||||
coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]);
|
coverDir = m_plugin.GetCoverFolderName(GameHdr->settings[0]);
|
||||||
|
|
||||||
if(coverDir == NULL || strlen(coverDir) == 0)
|
if(coverDir == NULL || strlen(coverDir) == 0)
|
||||||
|
{
|
||||||
strncpy(custom_banner, fmt("%s/%s.bnr", m->m_customBnrDir.c_str(), CoverFlow.getFilenameId(GameHdr)), 255);
|
strncpy(custom_banner, fmt("%s/%s.bnr", m->m_customBnrDir.c_str(), CoverFlow.getFilenameId(GameHdr)), 255);
|
||||||
|
strncpy(game_sound, fmt("%s/gamesounds/%s", m->m_dataDir.c_str(), CoverFlow.getFilenameId(GameHdr)), 255);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
strncpy(custom_banner, fmt("%s/%s/%s.bnr", m->m_customBnrDir.c_str(), coverDir, CoverFlow.getFilenameId(GameHdr)), 255);
|
strncpy(custom_banner, fmt("%s/%s/%s.bnr", m->m_customBnrDir.c_str(), coverDir, CoverFlow.getFilenameId(GameHdr)), 255);
|
||||||
|
strncpy(game_sound, fmt("%s/gamesounds/%s/%s", m->m_dataDir.c_str(), coverDir, CoverFlow.getFilenameId(GameHdr)), 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get plugin rom custom banner */
|
||||||
fsop_GetFileSizeBytes(custom_banner, &custom_bnr_size);
|
fsop_GetFileSizeBytes(custom_banner, &custom_bnr_size);
|
||||||
if(custom_bnr_size > 0)
|
if(custom_bnr_size > 0)
|
||||||
{
|
{
|
||||||
@ -2116,10 +2129,35 @@ void * CMenu::_gameSoundThread(void *obj)
|
|||||||
m_banner_loaded = true;
|
m_banner_loaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else // if no banner get plugin rom gamesound or just the default plugin gamesound
|
||||||
{
|
{
|
||||||
m_banner.DeleteBanner();
|
m_banner.DeleteBanner();
|
||||||
m->m_gameSound.Load(m_plugin.GetBannerSound(GameHdr->settings[0]), m_plugin.GetBannerSoundSize());
|
bool found = false;
|
||||||
|
char soundPath[256];
|
||||||
|
soundPath[255] = '\0';
|
||||||
|
if(fsop_FileExist(fmt("%s.mp3", game_sound)))
|
||||||
|
{
|
||||||
|
strncpy(soundPath, fmt("%s.mp3", game_sound), 255);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
else if(fsop_FileExist(fmt("%s.wav", game_sound)))
|
||||||
|
{
|
||||||
|
strncpy(soundPath, fmt("%s.wav", game_sound), 255);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
else if(fsop_FileExist(fmt("%s.ogg", game_sound)))
|
||||||
|
{
|
||||||
|
strncpy(soundPath, fmt("%s.ogg", game_sound), 255);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
if(found)
|
||||||
|
{
|
||||||
|
u32 size = 0;
|
||||||
|
u8 *sf = fsop_ReadFile(soundPath, &size);
|
||||||
|
m->m_gameSound.Load(sf, size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
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;
|
||||||
m->m_soundThrdBusy = false;
|
m->m_soundThrdBusy = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user