-re-added cover loading in game view

-increased priority of game banner sound thread to prevent
crashing
This commit is contained in:
fix94.1 2012-04-27 19:05:38 +00:00
parent f5407363fc
commit 2d6a737bc6
2 changed files with 14 additions and 9 deletions

View File

@ -1582,6 +1582,7 @@ void CMenu::_mainLoopCommon(bool withCF, bool blockReboot, bool adjusting)
if (withCF && m_gameSelected && m_gamesound_changed && (m_gameSoundHdr == NULL) && !m_gameSound.IsPlaying() && MusicPlayer::Instance()->GetVolume() == 0) if (withCF && m_gameSelected && m_gamesound_changed && (m_gameSoundHdr == NULL) && !m_gameSound.IsPlaying() && MusicPlayer::Instance()->GetVolume() == 0)
{ {
CheckGameSoundThread();
m_gameSound.Play(m_bnrSndVol); m_gameSound.Play(m_bnrSndVol);
m_gamesound_changed = false; m_gamesound_changed = false;
} }

View File

@ -388,7 +388,8 @@ void CMenu::_game(bool launch)
m_gameSelected = true; m_gameSelected = true;
_gameinfo(); _gameinfo();
_showGame(); _showGame();
if (!m_gameSound.IsPlaying()) startGameSound = -6; if (!m_gameSound.IsPlaying())
startGameSound = -6;
} }
else if (BTN_MINUS_PRESSED) else if (BTN_MINUS_PRESSED)
{ {
@ -464,7 +465,8 @@ void CMenu::_game(bool launch)
m_gameSelected = true; m_gameSelected = true;
_gameSettings(); _gameSettings();
_showGame(); _showGame();
if (!m_gameSound.IsPlaying()) startGameSound = -6; if (!m_gameSound.IsPlaying())
startGameSound = -6;
} }
else if (launch || m_btnMgr.selected(m_gameBtnPlay) || (!WPadIR_Valid(0) && !WPadIR_Valid(1) && !WPadIR_Valid(2) && !WPadIR_Valid(3) && m_btnMgr.selected((u32)-1))) else if (launch || m_btnMgr.selected(m_gameBtnPlay) || (!WPadIR_Valid(0) && !WPadIR_Valid(1) && !WPadIR_Valid(2) && !WPadIR_Valid(3) && m_btnMgr.selected((u32)-1)))
{ {
@ -1379,6 +1381,7 @@ struct IMD5Header
} __attribute__((packed)); } __attribute__((packed));
SmartBuf gameSoundThreadStack; SmartBuf gameSoundThreadStack;
unsigned int gameSoundThreadStackSize = (unsigned int)32768;
void CMenu::_gameSoundThread(CMenu *m) void CMenu::_gameSoundThread(CMenu *m)
{ {
@ -1428,13 +1431,14 @@ void CMenu::_gameSoundThread(CMenu *m)
void CMenu::_playGameSound(void) void CMenu::_playGameSound(void)
{ {
m_gamesound_changed = false; m_gamesound_changed = false;
if (m_bnrSndVol == 0) return; if(m_bnrSndVol == 0)
return;
CheckGameSoundThread(); CheckGameSoundThread();
unsigned int stack_size = (unsigned int)32768; if(!gameSoundThreadStack.get())
SMART_FREE(gameSoundThreadStack); gameSoundThreadStack = smartMem2Alloc(gameSoundThreadStackSize);
gameSoundThreadStack = smartMem2Alloc(stack_size);
LWP_CreateThread(&m_gameSoundThread, (void *(*)(void *))CMenu::_gameSoundThread, (void *)this, gameSoundThreadStack.get(), stack_size, 40); LWP_CreateThread(&m_gameSoundThread, (void *(*)(void *))CMenu::_gameSoundThread, (void *)this, gameSoundThreadStack.get(), gameSoundThreadStackSize, 60);
} }
void CMenu::CheckGameSoundThread() void CMenu::CheckGameSoundThread()
@ -1443,8 +1447,8 @@ void CMenu::CheckGameSoundThread()
LWP_ResumeThread(m_gameSoundThread); LWP_ResumeThread(m_gameSoundThread);
LWP_JoinThread(m_gameSoundThread, NULL); LWP_JoinThread(m_gameSoundThread, NULL);
if(gameSoundThreadStack.get())
SMART_FREE(gameSoundThreadStack); SMART_FREE(gameSoundThreadStack);
m_gameSoundThread = LWP_THREAD_NULL; m_gameSoundThread = LWP_THREAD_NULL;
} }