mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-24 02:41:55 +01:00
- some more fanart code cleanup
This commit is contained in:
parent
09e793655d
commit
0e58df8918
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 |
@ -58,33 +58,37 @@ bool CFanart::load(Config &m_wiiflowConfig, const char *path, const dir_discHdr
|
||||
strncpy(fanartDir, fmt("%s/%.3s", path, id), 163);
|
||||
texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", fanartDir));
|
||||
}
|
||||
if(texErr == TE_OK)
|
||||
if(texErr == TE_ERROR)
|
||||
{
|
||||
char faConfig_Path[164];
|
||||
faConfig_Path[163] = '\0';
|
||||
strncpy(faConfig_Path, fmt("%s/%s.ini", fanartDir, id), 163);
|
||||
m_faConfig.load(faConfig_Path);
|
||||
if(!m_faConfig.loaded() && !NoGameID(hdr->type))
|
||||
{
|
||||
strncpy(faConfig_Path, fmt("%s/%.3s.ini", fanartDir, id), 163);
|
||||
m_faConfig.load(faConfig_Path);
|
||||
if(!m_faConfig.loaded())
|
||||
{
|
||||
TexHandle.Cleanup(m_bg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
TexHandle.fromImageFile(m_bglq, fmt("%s/background_lq.png", fanartDir));
|
||||
for(int i = 1; i <= 6; i++)
|
||||
{
|
||||
CFanartElement elm(m_faConfig, fanartDir, i);
|
||||
if (elm.IsValid()) m_elms.push_back(elm);
|
||||
}
|
||||
m_loaded = true;
|
||||
m_defaultDelay = m_wiiflowConfig.getInt("FANART", "delay_after_animation", 200);
|
||||
m_delayAfterAnimation = m_faConfig.getInt("GENERAL", "delay_after_animation", m_defaultDelay);
|
||||
m_globalShowCoverAfterAnimation = m_wiiflowConfig.getOptBool("FANART", "show_cover_after_animation", 2);
|
||||
TexHandle.Cleanup(m_bg);
|
||||
return false;
|
||||
}
|
||||
|
||||
char faConfig_Path[164];
|
||||
faConfig_Path[163] = '\0';
|
||||
strncpy(faConfig_Path, fmt("%s/%s.ini", fanartDir, id), 163);
|
||||
m_faConfig.load(faConfig_Path);
|
||||
if(!m_faConfig.loaded() && !NoGameID(hdr->type))
|
||||
{
|
||||
strncpy(faConfig_Path, fmt("%s/%.3s.ini", fanartDir, id), 163);
|
||||
m_faConfig.load(faConfig_Path);
|
||||
}
|
||||
if(!m_faConfig.loaded())
|
||||
{
|
||||
TexHandle.Cleanup(m_bg);
|
||||
return false;
|
||||
}
|
||||
|
||||
TexHandle.fromImageFile(m_bglq, fmt("%s/background_lq.png", fanartDir));
|
||||
for(int i = 1; i <= 6; i++)
|
||||
{
|
||||
CFanartElement elm(m_faConfig, fanartDir, i);
|
||||
if(elm.IsValid()) m_elms.push_back(elm);
|
||||
}
|
||||
m_loaded = true;
|
||||
m_defaultDelay = m_wiiflowConfig.getInt("FANART", "delay_after_animation", 200);
|
||||
m_delayAfterAnimation = m_faConfig.getInt("GENERAL", "delay_after_animation", m_defaultDelay);
|
||||
m_globalShowCoverAfterAnimation = m_wiiflowConfig.getOptBool("FANART", "show_cover_after_animation", 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ void CMenu::_hideGame(bool instant)
|
||||
|
||||
void CMenu::_showGame(void)
|
||||
{
|
||||
CoverFlow.showCover();
|
||||
bool faPrevLoaded = m_fa.isLoaded();
|
||||
|
||||
const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
||||
const char *coverDir = NULL;
|
||||
@ -334,12 +334,14 @@ void CMenu::_showGame(void)
|
||||
const TexData *bg = NULL;
|
||||
const TexData *bglq = NULL;
|
||||
m_fa.getBackground(bg, bglq);
|
||||
if(bg != NULL && bglq != NULL)
|
||||
_setBg(*bg, *bglq);
|
||||
_setBg(*bg, *bglq);
|
||||
CoverFlow.hideCover();
|
||||
}
|
||||
else
|
||||
else if(faPrevLoaded)
|
||||
{
|
||||
CoverFlow.showCover();
|
||||
_setMainBg();
|
||||
}
|
||||
}
|
||||
|
||||
void CMenu::_cleanupBanner(bool gamechange)
|
||||
|
Loading…
Reference in New Issue
Block a user