-changed a few things about wait message and

game sound thread checks, hopefully fixes a
few random freezes or not stopping loading
This commit is contained in:
fix94.1 2012-03-06 13:53:25 +00:00
parent 1fb7628da7
commit 2247728e6a
2 changed files with 10 additions and 8 deletions

View File

@ -519,7 +519,6 @@ void CVideo::_showWaitMessages(CVideo *m)
m->m_waitMessages.clear();
//gprintf("Stop showing images\n");
m->m_showingWaitMessages = false;
m->CheckWaitThread(false);
gprintf("Stop showing images\n");
}
@ -527,13 +526,14 @@ void CVideo::hideWaitMessage()
{
gprintf("Now hide wait message\n");
m_showWaitMessage = false;
CheckWaitThread(true);
}
void CVideo::CheckWaitThread(bool force)
{
gprintf("Check wait thread start\n");
if (force || !m_showingWaitMessages ) //&& waitThread != LWP_THREAD_NULL))
if (force || !m_showingWaitMessages) //&& waitThread != LWP_THREAD_NULL))
{
gprintf("Check wait thread start\n");
if (waitThread != LWP_THREAD_NULL)
{
//m_showWaitMessage = false;
@ -549,8 +549,8 @@ void CVideo::CheckWaitThread(bool force)
m_waitMessages.clear();
}
}
gprintf("Check wait thread end\n");
}
}
void CVideo::waitMessage(float delay)
@ -593,6 +593,7 @@ void CVideo::waitMessage(const safe_vector<STexture> &tex, float delay, bool use
waitMessage(m_waitMessages[0]);
else if (m_waitMessages.size() > 1)
{
CheckWaitThread(true);
m_showWaitMessage = true;
unsigned int stack_size = (unsigned int)32768; //Try 32768?
SMART_FREE(waitThreadStack);

View File

@ -323,6 +323,7 @@ void CMenu::_game(bool launch)
if (!launch)
{
SetupInput();
m_cf.stopCoverLoader();
_playGameSound();
_showGame();
m_gameSelected = true;
@ -351,6 +352,7 @@ void CMenu::_game(bool launch)
if (BTN_HOME_PRESSED || BTN_B_PRESSED)
{
m_gameSound.Stop();
CheckGameSoundThread();
break;
}
@ -661,6 +663,7 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool DML)
m_gcfg1.save(true);
m_cfg.save(true);
CheckGameSoundThread();
cleanup();
Close_Inputs();
USBStorage_Deinit();
@ -1307,12 +1310,10 @@ void CMenu::_playGameSound(void)
m_gamesound_changed = false;
if (m_bnrSndVol == 0) return;
m_cf.stopCoverLoader();
CheckGameSoundThread();
unsigned int stack_size = (unsigned int)32768;
SMART_FREE(gameSoundThreadStack);
gameSoundThreadStack = smartMem2Alloc(stack_size);
CheckGameSoundThread();
LWP_CreateThread(&m_gameSoundThread, (void *(*)(void *))CMenu::_gameSoundThread, (void *)this, gameSoundThreadStack.get(), stack_size, 40);
}