diff --git a/out/boot.dol b/out/boot.dol index 16a1fa29..fb5ca53f 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/source/gui/video.cpp b/source/gui/video.cpp index 669eb5af..597a19c1 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -298,6 +298,8 @@ void CVideo::set2DViewport(u32 w, u32 h, int x, int y) m_y2D = std::min(std::max(-50, y), 50); } +/* this takes what is drawn in the frame buffer and copies it to make a new texture/image set as whatever TexData &tex is */ +/* this is used by coverflow and updatebg */ void CVideo::renderToTexture(TexData &tex, bool clear) { if(tex.data == NULL) diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index bba8b26c..517571e2 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -1826,10 +1826,10 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting) #endif } -void CMenu::_setBg(const TexData &bgTex, const TexData &bglqTex) +void CMenu::_setBg(const TexData &bgTex, const TexData &bglqTex, bool force_change) { /* Not setting same bg again */ - if(m_nextBg == &bgTex) + if(!force_change && m_nextBg == &bgTex) return; m_lqBg = &bglqTex; /* before setting new next bg set previous */ diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index f9ef5ce4..f6eb6601 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -168,6 +168,7 @@ private: string m_ver; // Background image stuff + TexData sfbgimg; TexData m_curBg; const TexData *m_prevBg; const TexData *m_nextBg; @@ -1020,7 +1021,7 @@ private: void _updateCheckboxes(void); void _getGameCategories(void); void _setGameCategories(void); - void _setBg(const TexData &bgTex, const TexData &bglqTex); + void _setBg(const TexData &bgTex, const TexData &bglqTex, bool force_change = false); void _updateBg(void); void _drawBg(void); void _updateText(void); @@ -1078,6 +1079,7 @@ private: int _getSrcFlow(); void _setSrcFlow(int version); void _srcTierBack(bool home); + void _setSrcFlowBg(); void _mainLoopCommon(bool withCF = false, bool adjusting = false); void _netInit(); void _loadDefaultFont(void); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 3268eb96..ffad5bee 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -288,6 +288,7 @@ int CMenu::main(void) if(m_sourceflow)//if exiting sourceflow via b button { m_sourceflow = false; + _setBg(m_mainBg, m_mainBgLQ); _showCF(true); continue; } @@ -305,6 +306,7 @@ int CMenu::main(void) if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled", false))//if sourceflow show it { m_sourceflow = true; + _setSrcFlowBg(); _showCF(true); } else //show source menu diff --git a/source/menu/menu_source.cpp b/source/menu/menu_source.cpp index 878c74df..c05cd804 100644 --- a/source/menu/menu_source.cpp +++ b/source/menu/menu_source.cpp @@ -122,6 +122,7 @@ void CMenu::_sourceFlow() } srcDomain = m_source.nextDomain().c_str(); } + _setSrcFlowBg(); return; } } @@ -131,6 +132,7 @@ void CMenu::_sourceFlow() m_cfg.setUInt("GENERAL", "sources", m_current_view); m_source_cnt = 1; _setSrcOptions(); + _setBg(m_mainBg, m_mainBgLQ); } int CMenu::_getSrcFlow(void) @@ -186,6 +188,23 @@ void CMenu::_srcTierBack(bool home) } srcDomain = m_source.nextDomain().c_str(); } + _setSrcFlowBg(); +} + +void CMenu::_setSrcFlowBg(void) +{ + string fn = m_source.getString("general", "background", ""); + if(fn.length() > 0) + { + TexHandle.Cleanup(sfbgimg); + if(TexHandle.fromImageFile(sfbgimg, fmt("%s/backgrounds/%s", m_sourceDir.c_str(), fn.c_str())) == TE_OK) + { + //const TexData *sfbg = &sfbgimg; + _setBg(sfbgimg, sfbgimg, true); + } + } + else + _setBg(m_mainBg, m_mainBgLQ); } void CMenu::_hideSource(bool instant)