From 7df52f2463e15a2c22639cbcc2dd83b9d7896b90 Mon Sep 17 00:00:00 2001 From: natural-law Date: Mon, 11 Oct 2010 08:21:20 +0000 Subject: [PATCH] issue #168 --- CocosDenshion/CocosDenshion.vcproj | 1 - .../SimpleAudioEngine/SimpleAudioEngine.cpp | 16 +++++++++------- .../SimpleAudioEngine/SimpleAudioEngine.h | 2 +- TestAudioEngine/TestAudioEngine.vcproj | 3 +-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CocosDenshion/CocosDenshion.vcproj b/CocosDenshion/CocosDenshion.vcproj index d92eaf04e3..34cff6b686 100644 --- a/CocosDenshion/CocosDenshion.vcproj +++ b/CocosDenshion/CocosDenshion.vcproj @@ -49,7 +49,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" - DisableSpecificWarnings="4251" /> resize(0); + m_pEffectPlayers = new PlayerArray(); } SimpleAudioEngine::~SimpleAudioEngine() @@ -100,7 +101,7 @@ void SimpleAudioEngine::SetEffectsVolume(int volume) { PlayerArrayIterator iter; - for (iter = m_EffectPlayers.begin(); iter != m_EffectPlayers.end(); ++iter) + for (iter = m_pEffectPlayers->begin(); iter != m_pEffectPlayers->end(); ++iter) { if (*iter) { @@ -220,9 +221,9 @@ void SimpleAudioEngine::playPreloadedEffect(int nSoundId) SoundPlayer* pPlayer = pElement->pPlayer; if (!pPlayer) { - // find the not playing player in m_EffectPlayers + // find the not playing player in m_pEffectPlayers PlayerArrayIterator iter; - for (iter = m_EffectPlayers.begin(); iter != m_EffectPlayers.end(); ++iter) + for (iter = m_pEffectPlayers->begin(); iter != m_pEffectPlayers->end(); ++iter) { if ((*iter) && !(*iter)->IsPlaying()) { @@ -235,7 +236,7 @@ void SimpleAudioEngine::playPreloadedEffect(int nSoundId) if (!pPlayer) { pPlayer = new SoundPlayer(); - m_EffectPlayers.push_back(pPlayer); + m_pEffectPlayers->push_back(pPlayer); // set the player volume pPlayer->SetVolumeValue(m_nEffectsVolume); @@ -262,7 +263,7 @@ void SimpleAudioEngine::removeAllEffectPlayers() { PlayerArrayIterator iter; - for (iter = m_EffectPlayers.begin(); iter != m_EffectPlayers.end(); ++iter) + for (iter = m_pEffectPlayers->begin(); iter != m_pEffectPlayers->end(); ++iter) { if (*iter) { @@ -270,5 +271,6 @@ void SimpleAudioEngine::removeAllEffectPlayers() } } - m_EffectPlayers.clear(); + m_pEffectPlayers->clear(); + delete m_pEffectPlayers; } diff --git a/CocosDenshion/SimpleAudioEngine/SimpleAudioEngine.h b/CocosDenshion/SimpleAudioEngine/SimpleAudioEngine.h index 2a12bbe3e5..e6860307ed 100644 --- a/CocosDenshion/SimpleAudioEngine/SimpleAudioEngine.h +++ b/CocosDenshion/SimpleAudioEngine/SimpleAudioEngine.h @@ -102,7 +102,7 @@ protected: bool m_bWillPlayBackgroundMusic; SoundPlayer m_obBackPlayer; - PlayerArray m_EffectPlayers; + PlayerArray* m_pEffectPlayers; // use hash map to save the effects loaded typedef struct _hashElement diff --git a/TestAudioEngine/TestAudioEngine.vcproj b/TestAudioEngine/TestAudioEngine.vcproj index 6461fb2cf5..332e6ebd23 100644 --- a/TestAudioEngine/TestAudioEngine.vcproj +++ b/TestAudioEngine/TestAudioEngine.vcproj @@ -50,7 +50,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" - DisableSpecificWarnings="4251" ForcedIncludeFiles="" />