DragonNest/Common/EtInterface/EtUISound.cpp
2024-12-20 16:56:44 +08:00

40 lines
No EOL
1.6 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "StdAfx.h"
#include "EtUISound.h"
#include "EtSoundEngine.h"
#ifdef _DEBUG
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
#endif
CEtUISound::CEtUISound(void)
{
for( int i=0; i<UI_SOUND_MAX; i++ ) {
m_uiSoundIndex[i] = -1;
}
}
CEtUISound::~CEtUISound(void)
{
}
void CEtUISound::Initialize()
{
}
void CEtUISound::Finalize()
{
for( int i=0; i<UI_SOUND_MAX; i++ ) {
if( m_uiSoundIndex[i] == -1 ) continue;
CEtSoundEngine::GetInstance().RemoveSound( m_uiSoundIndex[i] );
}
}
void CEtUISound::Play( emUI_SOUND uiSound )
{
if( uiSound == UI_SOUND_NONE )
return;
if( m_uiSoundIndex[uiSound] == -1 ) return;
ASSERT((uiSound<UI_SOUND_MAX)&&"CEtUISound::Play");
CEtSoundEngine::GetInstance().PlaySound( "2D", m_uiSoundIndex[uiSound] );
}