mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-24 02:41:55 +01:00
- removed some unused coverflow stuff. no longer needed.
This commit is contained in:
parent
8202b28a1a
commit
8bfe832e61
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 3.4 MiB |
@ -1549,27 +1549,6 @@ u64 CCoverFlow::getChanTitle(void) const
|
||||
m_items[loopNum(m_covers[m_range / 2].index + m_jump, m_items.size())].hdr->settings[1]);
|
||||
}
|
||||
|
||||
bool CCoverFlow::getRenderTex(void)
|
||||
{
|
||||
return m_renderTex;
|
||||
}
|
||||
|
||||
void CCoverFlow::setRenderTex(bool val)
|
||||
{
|
||||
m_renderTex = val;
|
||||
}
|
||||
|
||||
void CCoverFlow::RenderTex(void)
|
||||
{
|
||||
if(m_renderingTex != NULL && m_renderingTex->data != NULL)
|
||||
{
|
||||
LockMutex lock(m_mutex);
|
||||
DrawTexture(m_renderingTex);
|
||||
m_vid.renderToTexture(*m_renderingTex, true);
|
||||
}
|
||||
setRenderTex(false);
|
||||
}
|
||||
|
||||
bool CCoverFlow::select(void)
|
||||
{
|
||||
if (m_covers == NULL || m_jump != 0) return false;
|
||||
@ -2664,123 +2643,6 @@ bool CCoverFlow::fullCoverCached(const char *wfcPath)
|
||||
return found;
|
||||
}
|
||||
|
||||
bool CCoverFlow::_loadCoverTexPNG(u32 i, bool box, bool hq, bool blankBoxCover)
|
||||
{
|
||||
if(!m_loadingCovers)
|
||||
return false;
|
||||
|
||||
if(box && m_smallBox)// prevent full cover for smallbox mode
|
||||
return false;
|
||||
|
||||
/* get path to cover png or jpg */
|
||||
const char *path = box ? (blankBoxCover ? mainMenu.getBlankCoverPath(m_items[i].hdr) :
|
||||
mainMenu.getBoxPath(m_items[i].hdr)) : mainMenu.getFrontPath(m_items[i].hdr);
|
||||
if(path == NULL)
|
||||
return false;
|
||||
|
||||
/* copy path to coverPath */
|
||||
size_t path_len = strlen(path);
|
||||
char *coverPath = (char*)MEM2_alloc(path_len+1);
|
||||
if(coverPath == NULL)
|
||||
return false;
|
||||
memset(coverPath, 0, path_len+1);
|
||||
memcpy(coverPath, path, path_len);
|
||||
DCFlushRange(coverPath, path_len+1);
|
||||
|
||||
/* load cover png or jpg as a new texture */
|
||||
TexData tex;
|
||||
tex.thread = true;
|
||||
m_renderingTex = &tex;
|
||||
u8 textureFmt = m_compressTextures ? GX_TF_CMPR : GX_TF_RGB565;
|
||||
if(TexHandle.fromImageFile(tex, coverPath, textureFmt, 32) != TE_OK)
|
||||
{
|
||||
MEM2_free(coverPath);
|
||||
m_renderingTex = NULL;
|
||||
return false;
|
||||
}
|
||||
MEM2_free(coverPath);
|
||||
m_renderingTex = NULL;
|
||||
if(!m_loadingCovers)
|
||||
return false;
|
||||
|
||||
/* set the current coverflow cover to the new texture */
|
||||
LWP_MutexLock(m_mutex);
|
||||
TexHandle.Cleanup(m_items[i].texture);
|
||||
m_items[i].texture = tex;
|
||||
m_items[i].boxTexture = box;
|
||||
m_items[i].state = STATE_Ready;
|
||||
LWP_MutexUnlock(m_mutex);
|
||||
|
||||
/* save the texture as a wfc file to the cache folder for the next time */
|
||||
if(!m_cachePath.empty())
|
||||
{
|
||||
u32 bufSize = fixGX_GetTexBufferSize(tex.width, tex.height, tex.format, tex.maxLOD > 0 ? GX_TRUE : GX_FALSE, tex.maxLOD);
|
||||
if(tex.data != NULL)
|
||||
{
|
||||
const char *wfcTitle = NULL;
|
||||
const char *wfcCoverDir = NULL;
|
||||
char *full_path = (char*)MEM2_alloc(MAX_FAT_PATH+1);
|
||||
if(full_path == NULL)
|
||||
return false;
|
||||
memset(full_path, 0, MAX_FAT_PATH+1);
|
||||
|
||||
/* get title for wfc file */
|
||||
if(blankBoxCover)
|
||||
{
|
||||
const char *blankCoverPath = mainMenu.getBlankCoverPath(m_items[i].hdr);
|
||||
if(blankCoverPath != NULL && strrchr(blankCoverPath, '/') != NULL)
|
||||
wfcTitle = strrchr(blankCoverPath, '/') + 1;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
wfcTitle = getFilenameId(m_items[i].hdr);
|
||||
|
||||
/* get coverfolder for plugins and sourceflow */
|
||||
if(m_items[i].hdr->type == TYPE_PLUGIN && m_pluginCacheFolders && !blankBoxCover)
|
||||
wfcCoverDir = m_plugin.GetCoverFolderName(m_items[i].hdr->settings[0]);
|
||||
if(m_items[i].hdr->type == TYPE_SOURCE && !blankBoxCover)
|
||||
wfcCoverDir = "sourceflow";
|
||||
|
||||
/* make coverfolder if needed and set full path of wfc file */
|
||||
if(wfcCoverDir != NULL)
|
||||
{
|
||||
fsop_MakeFolder(fmt("%s/%s", m_cachePath.c_str(), wfcCoverDir));// will make subfolders if needed
|
||||
if(m_smallBox)
|
||||
strncpy(full_path, fmt("%s/%s/%s_small.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH);
|
||||
else
|
||||
strncpy(full_path, fmt("%s/%s/%s.wfc", m_cachePath.c_str(), wfcCoverDir, wfcTitle), MAX_FAT_PATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_smallBox)
|
||||
strncpy(full_path, fmt("%s/%s_small.wfc", m_cachePath.c_str(), wfcTitle), MAX_FAT_PATH);
|
||||
else
|
||||
strncpy(full_path, fmt("%s/%s.wfc", m_cachePath.c_str(), wfcTitle), MAX_FAT_PATH);
|
||||
}
|
||||
|
||||
DCFlushRange(full_path, MAX_FAT_PATH+1);
|
||||
|
||||
/* finally write the wfc file to the cache */
|
||||
FILE *file;
|
||||
file = fopen(full_path, "wb");
|
||||
MEM2_free(full_path);
|
||||
if(file != NULL)
|
||||
{
|
||||
SWFCHeader header(tex, box, false);
|
||||
fwrite(&header, 1, sizeof(header), file);
|
||||
fwrite(tex.data, 1, bufSize, file);
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* note the wfc texture file is full LOD */
|
||||
if(!hq)
|
||||
_dropHQLOD(i);// drop Level Of Detail of texture
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCoverFlow::_calcTexLQLOD(TexData &tex)
|
||||
{
|
||||
bool done = false;
|
||||
|
@ -138,10 +138,6 @@ public:
|
||||
u64 getChanTitle(void) const;
|
||||
const char *getFilenameId(const dir_discHdr *curHdr);
|
||||
//
|
||||
bool getRenderTex(void);
|
||||
void setRenderTex(bool);
|
||||
void RenderTex(void);
|
||||
//
|
||||
static u32 InternalCoverColor(const char *ID, u32 DefCaseColor);
|
||||
static bool checkCoverColor(const char *ID, const char *checkID[], u32 len);
|
||||
private:
|
||||
@ -341,7 +337,6 @@ private:
|
||||
void _loadAllCovers(int i);
|
||||
static bool _calcTexLQLOD(TexData &tex);
|
||||
void _dropHQLOD(int i);
|
||||
bool _loadCoverTexPNG(u32 i, bool box, bool hq, bool blankBoxCover);
|
||||
CLRet _loadCoverTex(u32 i, bool box, bool hq, bool blankBoxCover);
|
||||
bool _invisibleCover(u32 x, u32 y);
|
||||
void _instantTarget(int i);
|
||||
|
@ -430,24 +430,6 @@ TexErr STexture::fromPNG(TexData &dest, const u8 *buffer, u8 f, u32 minMipSize,
|
||||
memset(tmpData2, 0, Size2);
|
||||
PNGU_DecodeToRGBA8(ctx, imgProp.imgWidth, imgProp.imgHeight, tmpData2, 0, 0xFF);
|
||||
PNGU_ReleaseImageContext(ctx);
|
||||
if(dest.thread && (imgProp.imgColorType == PNGU_COLOR_TYPE_GRAY_ALPHA
|
||||
|| imgProp.imgColorType == PNGU_COLOR_TYPE_RGB_ALPHA)
|
||||
&& imgProp.imgWidth <= 640 && imgProp.imgHeight <= 480)
|
||||
{
|
||||
dest.format = GX_TF_RGBA8;
|
||||
dest.width = imgProp.imgWidth;
|
||||
dest.height = imgProp.imgHeight;
|
||||
dest.dataSize = GX_GetTexBufferSize(dest.width, dest.height, dest.format, GX_FALSE, 0);
|
||||
dest.data = (u8*)MEM2_alloc(dest.dataSize);
|
||||
_convertToRGBA8(dest.data, tmpData2, dest.width, dest.height);
|
||||
DCFlushRange(dest.data, dest.dataSize);
|
||||
CoverFlow.setRenderTex(true);
|
||||
while(CoverFlow.getRenderTex())
|
||||
usleep(50);
|
||||
_convertToRGBA(tmpData2, dest.data, dest.width, dest.height);
|
||||
DCFlushRange(tmpData2, Size2);
|
||||
Cleanup(dest);
|
||||
}
|
||||
tmpData2 = _genMipMaps(tmpData2, imgProp.imgWidth, imgProp.imgHeight, maxLODTmp, baseWidth, baseHeight);
|
||||
if(tmpData2 == NULL)
|
||||
{
|
||||
|
@ -1657,8 +1657,6 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
|
||||
|
||||
/* background and coverflow drawing */
|
||||
_updateBg();
|
||||
if(CoverFlow.getRenderTex())
|
||||
CoverFlow.RenderTex();
|
||||
if(withCF && m_lqBg != NULL)
|
||||
CoverFlow.makeEffectTexture(m_lqBg);
|
||||
if(withCF && m_aa > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user