mirror of https://github.com/axmolengine/axmol.git
issue #168
This commit is contained in:
parent
09e9638b03
commit
7df52f2463
|
@ -49,7 +49,6 @@
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
DisableSpecificWarnings="4251"
|
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
|
|
@ -23,7 +23,8 @@ SimpleAudioEngine::SimpleAudioEngine()
|
||||||
, m_bWillPlayBackgroundMusic(false)
|
, m_bWillPlayBackgroundMusic(false)
|
||||||
, m_pEffects(NULL)
|
, m_pEffects(NULL)
|
||||||
{
|
{
|
||||||
m_EffectPlayers.resize(0);
|
//m_pEffectPlayers->resize(0);
|
||||||
|
m_pEffectPlayers = new PlayerArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleAudioEngine::~SimpleAudioEngine()
|
SimpleAudioEngine::~SimpleAudioEngine()
|
||||||
|
@ -100,7 +101,7 @@ void SimpleAudioEngine::SetEffectsVolume(int volume)
|
||||||
{
|
{
|
||||||
PlayerArrayIterator iter;
|
PlayerArrayIterator iter;
|
||||||
|
|
||||||
for (iter = m_EffectPlayers.begin(); iter != m_EffectPlayers.end(); ++iter)
|
for (iter = m_pEffectPlayers->begin(); iter != m_pEffectPlayers->end(); ++iter)
|
||||||
{
|
{
|
||||||
if (*iter)
|
if (*iter)
|
||||||
{
|
{
|
||||||
|
@ -220,9 +221,9 @@ void SimpleAudioEngine::playPreloadedEffect(int nSoundId)
|
||||||
SoundPlayer* pPlayer = pElement->pPlayer;
|
SoundPlayer* pPlayer = pElement->pPlayer;
|
||||||
if (!pPlayer)
|
if (!pPlayer)
|
||||||
{
|
{
|
||||||
// find the not playing player in m_EffectPlayers
|
// find the not playing player in m_pEffectPlayers
|
||||||
PlayerArrayIterator iter;
|
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())
|
if ((*iter) && !(*iter)->IsPlaying())
|
||||||
{
|
{
|
||||||
|
@ -235,7 +236,7 @@ void SimpleAudioEngine::playPreloadedEffect(int nSoundId)
|
||||||
if (!pPlayer)
|
if (!pPlayer)
|
||||||
{
|
{
|
||||||
pPlayer = new SoundPlayer();
|
pPlayer = new SoundPlayer();
|
||||||
m_EffectPlayers.push_back(pPlayer);
|
m_pEffectPlayers->push_back(pPlayer);
|
||||||
|
|
||||||
// set the player volume
|
// set the player volume
|
||||||
pPlayer->SetVolumeValue(m_nEffectsVolume);
|
pPlayer->SetVolumeValue(m_nEffectsVolume);
|
||||||
|
@ -262,7 +263,7 @@ void SimpleAudioEngine::removeAllEffectPlayers()
|
||||||
{
|
{
|
||||||
PlayerArrayIterator iter;
|
PlayerArrayIterator iter;
|
||||||
|
|
||||||
for (iter = m_EffectPlayers.begin(); iter != m_EffectPlayers.end(); ++iter)
|
for (iter = m_pEffectPlayers->begin(); iter != m_pEffectPlayers->end(); ++iter)
|
||||||
{
|
{
|
||||||
if (*iter)
|
if (*iter)
|
||||||
{
|
{
|
||||||
|
@ -270,5 +271,6 @@ void SimpleAudioEngine::removeAllEffectPlayers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_EffectPlayers.clear();
|
m_pEffectPlayers->clear();
|
||||||
|
delete m_pEffectPlayers;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ protected:
|
||||||
bool m_bWillPlayBackgroundMusic;
|
bool m_bWillPlayBackgroundMusic;
|
||||||
|
|
||||||
SoundPlayer m_obBackPlayer;
|
SoundPlayer m_obBackPlayer;
|
||||||
PlayerArray m_EffectPlayers;
|
PlayerArray* m_pEffectPlayers;
|
||||||
|
|
||||||
// use hash map to save the effects loaded
|
// use hash map to save the effects loaded
|
||||||
typedef struct _hashElement
|
typedef struct _hashElement
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
DisableSpecificWarnings="4251"
|
|
||||||
ForcedIncludeFiles=""
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -97,7 +96,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
CommandLine="mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData
mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\background.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\Effect1.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\Effect2.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData"
|
CommandLine="mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData
mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\background.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\Effect1.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\Effect2.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
|
|
Loading…
Reference in New Issue