This commit is contained in:
natural-law 2010-10-11 08:21:20 +00:00
parent 09e9638b03
commit 7df52f2463
4 changed files with 11 additions and 11 deletions

View File

@ -49,7 +49,6 @@
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
DisableSpecificWarnings="4251"
/>
<Tool
Name="VCManagedResourceCompilerTool"

View File

@ -23,7 +23,8 @@ SimpleAudioEngine::SimpleAudioEngine()
, m_bWillPlayBackgroundMusic(false)
, m_pEffects(NULL)
{
m_EffectPlayers.resize(0);
//m_pEffectPlayers->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;
}

View File

@ -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

View File

@ -50,7 +50,6 @@
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
DisableSpecificWarnings="4251"
ForcedIncludeFiles=""
/>
<Tool
@ -97,7 +96,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\background.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\Effect1.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\Effect2.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData"
CommandLine="mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\background.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\Effect1.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\Effect2.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;"
/>
</Configuration>
<Configuration