* (Hopefully) fixed crash in WaitMessage

* (Hopefully) fixed Fanart issues
* Added a way to show mem through gecko
This commit is contained in:
overjoy.psm 2012-01-30 14:29:40 +00:00
parent eb1f4e2876
commit 2505616944
7 changed files with 63 additions and 18 deletions

View File

@ -517,21 +517,27 @@ void CVideo::_showWaitMessages(CVideo *m)
WIILIGHT_TurnOff();
}
m->m_waitMessages.clear();
gprintf("Stop showing images\n");
//gprintf("Stop showing images\n");
m->m_showingWaitMessages = false;
m->CheckWaitThread(false);
gprintf("Stop showing images\n");
}
void CVideo::hideWaitMessage(bool force)
void CVideo::hideWaitMessage()
{
gprintf("Now hide wait message\n");
m_showWaitMessage = false;
CheckWaitThread(force);
}
void CVideo::CheckWaitThread(bool force)
{
if (force || (!m_showingWaitMessages && waitThread != LWP_THREAD_NULL))
gprintf("Check wait thread start\n");
if (force || !m_showingWaitMessages ) //&& waitThread != LWP_THREAD_NULL))
{
m_showWaitMessage = false;
if (waitThread != LWP_THREAD_NULL)
{
//m_showWaitMessage = false;
gprintf("Thread running. Stop it\n");
if(LWP_ThreadIsSuspended(waitThread))
LWP_ResumeThread(waitThread);
@ -544,6 +550,8 @@ void CVideo::CheckWaitThread(bool force)
m_waitMessages.clear();
}
}
gprintf("Check wait thread end\n");
}
void CVideo::waitMessage(float delay)
{
@ -552,7 +560,7 @@ void CVideo::waitMessage(float delay)
void CVideo::waitMessage(const safe_vector<STexture> &tex, float delay, bool useWiiLight)
{
hideWaitMessage(true);
hideWaitMessage();
m_useWiiLight = useWiiLight;

View File

@ -64,7 +64,7 @@ public:
void prepareStencil(void);
void renderStencil(void);
int stencilVal(int x, int y);
void hideWaitMessage(bool force = false);
void hideWaitMessage();
void waitMessage(float delay);
void waitMessage(const safe_vector<STexture> &tex, float delay, bool useWiiLight = true);
void waitMessage(const STexture &tex);

View File

@ -20,7 +20,7 @@ extern "C" { extern void __exception_setreload(int t);}
CMenu *mainMenu;
extern "C" void ShowError(const wstringEx &error){mainMenu->error(error); }
extern "C" void HideWaitMessage() {mainMenu->_hideWaitMessage(true); }
extern "C" void HideWaitMessage() {mainMenu->_hideWaitMessage(); }
int main(int argc, char **argv)
{

View File

@ -264,6 +264,8 @@ void CMenu::init(void)
makedir((char *)m_wipDir.c_str());
makedir((char *)m_listCacheDir.c_str());
m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
// INI files
m_cat.load(sfmt("%s/" CAT_FILENAME, m_settingsDir.c_str()).c_str());
string themeName = m_cfg.getString("GENERAL", "theme", "DEFAULT");
@ -1682,9 +1684,9 @@ void CMenu::_load_installed_cioses()
}
}
void CMenu::_hideWaitMessage(bool force)
void CMenu::_hideWaitMessage()
{
m_vid.hideWaitMessage(force);
m_vid.hideWaitMessage();
}
void CMenu::_showWaitMessage()

View File

@ -1,6 +1,7 @@
#ifndef __MENU_HPP
#define __MENU_HPP
//#define SHOWMEM 1
//#define SHOWMEMGECKO
#include <wiiuse/wpad.h>
#include <ogc/pad.h>
@ -144,6 +145,12 @@ private:
u32 m_mainLblLetter;
#ifdef SHOWMEM
u32 m_mem2FreeSize;
#endif
#ifdef SHOWMEMGECKO
unsigned int mem1old;
unsigned int mem1;
unsigned int mem2old;
unsigned int mem2;
#endif
u32 m_mainLblNotice;
u32 m_mainBtnNext;
@ -738,7 +745,7 @@ private:
safe_vector<STexture> _textures(TexSet &texSet, const char *domain, const char *key);
void _showWaitMessage();
public:
void _hideWaitMessage(bool force = false);
void _hideWaitMessage();
private:
SmartGuiSound _sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const u8 * snd, u32 len, string name, bool isAllocated);
SmartGuiSound _sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, string name);

View File

@ -1277,5 +1277,19 @@ void CMenu::CheckGameSoundThread(bool force)
void CMenu::CheckThreads(bool force)
{
CheckGameSoundThread(force);
m_vid.CheckWaitThread(force);
//m_vid.CheckWaitThread(force);
#ifdef SHOWMEMGECKO
mem1 = SYS_GetArena1Size();
mem2 = MEM2_freesize();
if( mem1 != mem1old )
{
mem1old = mem1;
gprintf("Mem1 Free: %u\n", mem1);
}
if( mem2 != mem2old )
{
mem2old = mem2;
gprintf("Mem2 Free: %u\n", mem2);
}
#endif
}

View File

@ -80,6 +80,20 @@ void CMenu::_showMain(void)
_hideWaitMessage();
#ifdef SHOWMEM
m_btnMgr.show(m_mem2FreeSize);
#endif
#ifdef SHOWMEMGECKO
mem1 = SYS_GetArena1Size();
mem2 = MEM2_freesize();
if( mem1 != mem1old )
{
mem1old = mem1;
gprintf("Mem1 Free: %u\n", mem1);
}
if( mem2 != mem2old )
{
mem2old = mem2;
gprintf("Mem2 Free: %u\n", mem2);
}
#endif
m_vid.set2DViewport(m_cfg.getInt("GENERAL", "tv_width", 640), m_cfg.getInt("GENERAL", "tv_height", 480),
m_cfg.getInt("GENERAL", "tv_x", 0), m_cfg.getInt("GENERAL", "tv_y", 0));