Sync with cocos2d-x v3 branch ddb4dc8 commit.

This commit is contained in:
James Chen
2017-04-24 10:49:02 +08:00
parent 91cfd45ee9
commit fc98b4bdc0
115 changed files with 5389 additions and 2620 deletions
+10 -15
View File
@@ -1,6 +1,6 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
Copyright (c) 2013-2017 Chukong Technologies Inc.
http://www.cocos2d-x.org
@@ -78,12 +78,10 @@ void SimpleAudioEngine::end()
{
sharedMusic().Close();
EffectList::iterator p = sharedList().begin();
while (p != sharedList().end())
for (auto& iter : sharedList())
{
delete p->second;
p->second = nullptr;
p++;
delete iter.second;
iter.second = nullptr;
}
sharedList().clear();
return;
@@ -204,10 +202,9 @@ void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
void SimpleAudioEngine::pauseAllEffects()
{
EffectList::iterator iter;
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
for (auto& iter : sharedList())
{
iter->second->Pause();
iter.second->Pause();
}
}
@@ -222,19 +219,17 @@ void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
void SimpleAudioEngine::resumeAllEffects()
{
EffectList::iterator iter;
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
for (auto& iter : sharedList())
{
iter->second->Resume();
iter.second->Resume();
}
}
void SimpleAudioEngine::stopAllEffects()
{
EffectList::iterator iter;
for (iter = sharedList().begin(); iter != sharedList().end(); iter++)
for (auto& iter : sharedList())
{
iter->second->Stop();
iter.second->Stop();
}
}