本文整理汇总了C++中CServerDE::KillSound方法的典型用法代码示例。如果您正苦于以下问题:C++ CServerDE::KillSound方法的具体用法?C++ CServerDE::KillSound怎么用?C++ CServerDE::KillSound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CServerDE
的用法示例。
在下文中一共展示了CServerDE::KillSound方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StopShieldSound
void Gabriel::StopShieldSound()
{
CServerDE* pServerDE = GetServerDE();
if (!pServerDE || !m_hShieldSound) return;
if (m_hShieldSound)
{
pServerDE->KillSound(m_hShieldSound);
m_hShieldSound = DNULL;
}
}
示例2: SetOff
void Rotating::SetOff()
{
CServerDE* pServerDE = BaseClass::GetServerDE();
if (!pServerDE) return;
m_eState = RWM_OFF;
if (m_sndLastSound)
{
pServerDE->KillSound(m_sndLastSound);
m_sndLastSound = DNULL;
}
}
示例3:
CProjectile::~CProjectile()
{
CServerDE* pServerDE = BaseClass::GetServerDE();
if (!pServerDE) return;
if (m_hLight)
pServerDE->RemoveObject(m_hLight);
if (m_hSmokeTrail)
pServerDE->RemoveObject(m_hSmokeTrail);
if (m_hstrShockwaveFilename)
pServerDE->FreeString(m_hstrShockwaveFilename);
if (m_hSound)
{ pServerDE->KillSound(m_hSound); m_hSound = DNULL; }
}
示例4: StartSound
void Rotating::StartSound(HSTRING hstrSoundName, DBOOL bLoop)
{
CServerDE* pServerDE = BaseClass::GetServerDE();
if (!pServerDE) return;
// Stop the last sound if there is one...
if (m_sndLastSound)
{
pServerDE->KillSound(m_sndLastSound);
m_sndLastSound = DNULL;
}
if (!hstrSoundName) return;
char *pSoundName = pServerDE->GetStringData(hstrSoundName);
if (!pSoundName) return;
PlaySoundInfo playSoundInfo;
PLAYSOUNDINFO_INIT(playSoundInfo);
playSoundInfo.m_dwFlags = PLAYSOUND_3D | PLAYSOUND_REVERB;
playSoundInfo.m_dwFlags |= PLAYSOUND_ATTACHED;
if (bLoop)
{
playSoundInfo.m_dwFlags |= PLAYSOUND_LOOP | PLAYSOUND_GETHANDLE;
}
_mbsncpy((unsigned char*)playSoundInfo.m_szSoundName, (const unsigned char*)pSoundName, _MAX_PATH);
playSoundInfo.m_hObject = m_hObject;
playSoundInfo.m_fOuterRadius = m_fSoundRadius;
playSoundInfo.m_fInnerRadius = 200;
pServerDE->PlaySound(&playSoundInfo);
// Save the handle of the sound...
m_sndLastSound = playSoundInfo.m_hSound;
}