Permalink
Browse files

fixed #1600:update AppDelegate.cpp in xcode template

  • Loading branch information...
1 parent fdff654 commit bfcb19fa79d117b20a5b44eee4aa2468e713ed58 @minggo minggo committed Dec 6, 2012
@@ -46,17 +46,15 @@ bool AppDelegate::applicationDidFinishLaunching()
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground()
{
- CCDirector::sharedDirector()->pause();
-
- // if you use SimpleAudioEngine, it must be paused
- // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ CCDirector::sharedDirector()->stopAnimation();
+ SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->pauseAllEffects();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
- CCDirector::sharedDirector()->resume();
-
- // if you use SimpleAudioEngine, it must resume here
- // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ CCDirector::sharedDirector()->startAnimation();
+ SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->resumeAllEffects();
}
@@ -47,16 +47,14 @@ bool AppDelegate::applicationDidFinishLaunching()
void AppDelegate::applicationDidEnterBackground()
{
CCDirector::sharedDirector()->stopAnimation();
-
- // if you use SimpleAudioEngine, it must be paused
- // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->pauseAllEffects();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
CCDirector::sharedDirector()->startAnimation();
-
- // if you use SimpleAudioEngine, it must resume here
- // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->resumeAllEffects();
}
@@ -47,16 +47,14 @@ bool AppDelegate::applicationDidFinishLaunching()
void AppDelegate::applicationDidEnterBackground()
{
CCDirector::sharedDirector()->stopAnimation();
-
- // if you use SimpleAudioEngine, it must be pause
- // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->pauseAllEffects();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
CCDirector::sharedDirector()->startAnimation();
-
- // if you use SimpleAudioEngine, it must resume here
- // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->resumeAllEffects();
}
@@ -56,11 +56,13 @@ void AppDelegate::applicationDidEnterBackground()
{
CCDirector::sharedDirector()->stopAnimation();
SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->pauseAllEffects();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
CCDirector::sharedDirector()->startAnimation();
SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+ SimpleAudioEngine::sharedEngine()->resumeAllEffects();
}

0 comments on commit bfcb19f

Please sign in to comment.