mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 09:05:06 +01:00
-added proper texture, font and sound cleanup (should fix most
game booting problems when using a theme)
This commit is contained in:
parent
c3c02ac862
commit
f606df9b2d
@ -521,6 +521,25 @@ void CMenu::cleanup()
|
|||||||
ClearLogBuffer();
|
ClearLogBuffer();
|
||||||
Close_Inputs();
|
Close_Inputs();
|
||||||
|
|
||||||
|
for(TexSet::iterator texture = theme.texSet.begin(); texture != theme.texSet.end(); texture++)
|
||||||
|
{
|
||||||
|
if(texture->second.data.get())
|
||||||
|
texture->second.data.release();
|
||||||
|
}
|
||||||
|
theme.texSet.clear();
|
||||||
|
for(FontSet::iterator font = theme.fontSet.begin(); font != theme.fontSet.end(); font++)
|
||||||
|
{
|
||||||
|
if(font->second.data.get())
|
||||||
|
font->second.data.release();
|
||||||
|
}
|
||||||
|
theme.fontSet.clear();
|
||||||
|
for(SoundSet::iterator sound = theme.soundSet.begin(); sound != theme.soundSet.end(); sound++)
|
||||||
|
{
|
||||||
|
if(sound->second.get())
|
||||||
|
sound->second.release();
|
||||||
|
}
|
||||||
|
theme.soundSet.clear();
|
||||||
|
|
||||||
cleaned_up = true;
|
cleaned_up = true;
|
||||||
gprintf(" \nMemory cleaned up\n");
|
gprintf(" \nMemory cleaned up\n");
|
||||||
}
|
}
|
||||||
@ -859,9 +878,8 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
|
|||||||
|
|
||||||
void CMenu::_buildMenus(void)
|
void CMenu::_buildMenus(void)
|
||||||
{
|
{
|
||||||
SThemeData theme;
|
if(!m_base_font.get())
|
||||||
|
_loadDefaultFont(CONF_GetLanguage() == CONF_LANG_KOREAN);
|
||||||
if(!m_base_font.get()) _loadDefaultFont(CONF_GetLanguage() == CONF_LANG_KOREAN);
|
|
||||||
|
|
||||||
// Default fonts
|
// Default fonts
|
||||||
theme.btnFont = _font(theme.fontSet, "GENERAL", "button_font", BUTTONFONT);
|
theme.btnFont = _font(theme.fontSet, "GENERAL", "button_font", BUTTONFONT);
|
||||||
@ -1186,6 +1204,7 @@ STexture CMenu::_texture(CMenu::TexSet &texSet, const char *domain, const char *
|
|||||||
STexture tex;
|
STexture tex;
|
||||||
if (STexture::TE_OK == tex.fromPNGFile(fmt("%s/%s", m_themeDataDir.c_str(), filename.c_str()), GX_TF_RGBA8, ALLOC_MEM2))
|
if (STexture::TE_OK == tex.fromPNGFile(fmt("%s/%s", m_themeDataDir.c_str(), filename.c_str()), GX_TF_RGBA8, ALLOC_MEM2))
|
||||||
{
|
{
|
||||||
|
def.data.release();
|
||||||
texSet[filename] = tex;
|
texSet[filename] = tex;
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
@ -696,7 +696,7 @@ private:
|
|||||||
typedef pair<string, u32> FontDesc;
|
typedef pair<string, u32> FontDesc;
|
||||||
typedef map<FontDesc, SFont> FontSet;
|
typedef map<FontDesc, SFont> FontSet;
|
||||||
typedef map<string, STexture> TexSet;
|
typedef map<string, STexture> TexSet;
|
||||||
typedef map<string, SmartGuiSound > SoundSet;
|
typedef map<string, SmartGuiSound> SoundSet;
|
||||||
struct SThemeData
|
struct SThemeData
|
||||||
{
|
{
|
||||||
TexSet texSet;
|
TexSet texSet;
|
||||||
@ -791,6 +791,7 @@ private:
|
|||||||
SmartGuiSound hoverSound;
|
SmartGuiSound hoverSound;
|
||||||
SmartGuiSound cameraSound;
|
SmartGuiSound cameraSound;
|
||||||
};
|
};
|
||||||
|
SThemeData theme;
|
||||||
struct SCFParamDesc
|
struct SCFParamDesc
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
|
Loading…
Reference in New Issue
Block a user