From f6830b5a2f8318d30b38f03dd23e978858c10def Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Fri, 4 May 2012 14:08:44 +0000 Subject: [PATCH] -fixed problem that covers were not loading properly with only a few games in a coverflow view -added new option to wiiflow.ini GENERAL section, "cover_use_hq", if you set it to yes all your covers will be displayed in HQ again, but will also slowdown the loading and wiiflow in general --- source/gui/coverflow.cpp | 23 ++++++++++++++--------- source/gui/coverflow.hpp | 2 ++ source/menu/menu.cpp | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/gui/coverflow.cpp b/source/gui/coverflow.cpp index aadcd3e0..e2415658 100644 --- a/source/gui/coverflow.cpp +++ b/source/gui/coverflow.cpp @@ -203,6 +203,7 @@ CCoverFlow::CCoverFlow(void) m_compressCache = false; m_deletePicsAfterCaching = false; m_box = true; + m_useHQcover = false; m_rows = 1; m_columns = 11; m_range = m_rows * m_columns; @@ -277,6 +278,11 @@ void CCoverFlow::setBoxMode(bool box) m_box = box; } +void CCoverFlow::setHQcover(bool HQ) +{ + m_useHQcover = HQ; +} + void CCoverFlow::setBufferSize(u32 numCovers) { if (!m_covers.empty()) return; @@ -2674,15 +2680,13 @@ int CCoverFlow::_coverLoader(CCoverFlow *cf) u32 i; u32 bufferSize = cf->m_range + cf->m_numBufCovers; - if(bufferSize >= cf->m_items.size()) - bufferSize = cf->m_items.size(); - while (cf->m_loadingCovers) + while(cf->m_loadingCovers) { update = cf->m_moved; cf->m_moved = false; - for (u32 j = cf->m_items.size(); j >= bufferSize && cf->m_loadingCovers && !cf->m_moved && update; --j) + for(u32 j = cf->m_items.size(); j >= bufferSize && cf->m_loadingCovers && !cf->m_moved && update; --j) { firstItem = cf->m_covers[cf->m_range / 2].index; i = loopNum((j & 1) ? firstItem - (j + 1) / 2 : firstItem + j / 2, cf->m_items.size()); @@ -2692,20 +2696,21 @@ int CCoverFlow::_coverLoader(CCoverFlow *cf) LWP_MutexUnlock(cf->m_mutex); } ret = CCoverFlow::CL_OK; - for (u32 j = 0; j <= bufferSize && cf->m_loadingCovers && !cf->m_moved && update && ret != CCoverFlow::CL_NOMEM; ++j) + for(u32 j = 0; j <= bufferSize && cf->m_loadingCovers && !cf->m_moved && update && ret != CCoverFlow::CL_NOMEM; ++j) { firstItem = cf->m_covers[cf->m_range / 2].index; i = loopNum((j & 1) ? firstItem - (j + 1) / 2 : firstItem + j / 2, cf->m_items.size()); - if (cf->m_items[i].state != CCoverFlow::STATE_Loading) + if(cf->m_items[i].state != CCoverFlow::STATE_Loading) continue; - - if ((ret = cf->_loadCoverTex(i, cf->m_box, i == (u32)firstItem)) == CCoverFlow::CL_ERROR) + if(firstItem == (u32)cf->m_hqCover && cf->m_useHQcover) + continue; + if((ret = cf->_loadCoverTex(i, cf->m_box, i == (u32)firstItem)) == CCoverFlow::CL_ERROR) { if ((ret = cf->_loadCoverTex(i, !cf->m_box, i == (u32)firstItem)) == CCoverFlow::CL_ERROR) cf->m_items[i].state = CCoverFlow::STATE_NoCover; } } - if (ret == CCoverFlow::CL_NOMEM && bufferSize > 3) + if(ret == CCoverFlow::CL_NOMEM && bufferSize > 3) bufferSize -= 2; } return 0; diff --git a/source/gui/coverflow.hpp b/source/gui/coverflow.hpp index 1f0d2277..95a85bd9 100644 --- a/source/gui/coverflow.hpp +++ b/source/gui/coverflow.hpp @@ -86,6 +86,7 @@ public: void setFont(SFont font, const CColor &color); void setRange(u32 rows, u32 columns); void setBoxMode(bool box); + void setHQcover(bool HQ); void setTextureQuality(float lodBias, int aniso, bool edgeLOD); void setCameraPos(bool selected, const Vector3D &pos, const Vector3D &aim); void setCameraOsc(bool selected, const Vector3D &speed, const Vector3D &); @@ -256,6 +257,7 @@ private: CColor m_fanartFontColor; bool m_fanartPlaying; bool m_box; + bool m_useHQcover; u32 m_range; u32 m_rows; u32 m_columns; diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 0bac511f..b16373ad 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -1531,6 +1531,7 @@ void CMenu::_initCF(void) m_cf.setCompression(m_cfg.getBool("GENERAL", "allow_texture_compression", true)); m_cf.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20)); m_cf.setSorting((Sorting)m_cfg.getInt(domain, "sort", 0)); + m_cf.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", false)); if (m_curGameId.empty() || !m_cf.findId(m_curGameId.c_str(), true)) m_cf.findId(m_cfg.getString(domain, "current_item").c_str(), true); m_cf.startCoverLoader();