-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
This commit is contained in:
fix94.1 2012-05-04 14:08:44 +00:00
parent 31caf39cd2
commit f6830b5a2f
3 changed files with 17 additions and 9 deletions

View File

@ -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;

View File

@ -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 &amp);
@ -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;

View File

@ -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();