added new method to JSoundSystem to pause music. Previously, "pause" meant kill the music and "resume" effectively restarted the music. iOS will now pause and resume appropriately
modified pc and android impls to ensure new calls are made. These still have the same effective outcome (kill and start) until the equivalent is coded on these platforms to pause and resume the music. fixed bug with iOS sound effects not playing. Forgot to assign the key to the associated music sample
This commit is contained in:
@@ -474,12 +474,12 @@ void GameApp::SetCurrentState(GameState * state)
|
||||
|
||||
void GameApp::Pause()
|
||||
{
|
||||
stopMusic();
|
||||
pauseMusic();
|
||||
}
|
||||
|
||||
void GameApp::Resume()
|
||||
{
|
||||
playMusic();
|
||||
resumeMusic();
|
||||
}
|
||||
|
||||
void GameApp::DoTransition(int trans, int tostate, float dur, bool animonly)
|
||||
@@ -555,6 +555,24 @@ void GameApp::playMusic(string filename, bool loop)
|
||||
}
|
||||
}
|
||||
|
||||
void GameApp::pauseMusic()
|
||||
{
|
||||
if (music && currentMusicFile != "")
|
||||
{
|
||||
JSoundSystem::GetInstance()->PauseMusic(music);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GameApp::resumeMusic()
|
||||
{
|
||||
if (music && currentMusicFile != "")
|
||||
{
|
||||
JSoundSystem::GetInstance()->ResumeMusic(music);
|
||||
}
|
||||
}
|
||||
|
||||
void GameApp::stopMusic()
|
||||
{
|
||||
if (music && currentMusicFile != "")
|
||||
|
||||
Reference in New Issue
Block a user