本文整理汇总了C++中ISound::SetParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ISound::SetParam方法的具体用法?C++ ISound::SetParam怎么用?C++ ISound::SetParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISound
的用法示例。
在下文中一共展示了ISound::SetParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateSound
//------------------------------------------------------------------------
void CRapid::UpdateSound(float frameTime)
{
if (m_speed >= 0.00001f)
{
if (m_soundId == INVALID_SOUNDID)
{
m_soundId = m_pWeapon->PlayAction(m_pShared->rapidactions.rapid_fire, 0, true, CItem::eIPAF_Default & (~CItem::eIPAF_Animation));
}
if (m_soundId != INVALID_SOUNDID)
{
float rpm_scale = m_speed / m_pShared->rapidparams.min_speed;
float ammo = 0;
if (!OutOfAmmo())
{
ammo = 1.0f;
}
ISound *pSound = m_pWeapon->GetISound(m_soundId);
if (pSound)
{
if (g_pGameCVars->i_debug_sounds)
{
float color[] = {1, 1, 1, 0.5};
gEnv->pRenderer->Draw2dLabel(150, 500, 1.3f, color, false, "%s rpm_scale: %.2f", m_pWeapon->GetEntity()->GetName(), rpm_scale);
}
pSound->SetParam("rpm_scale", rpm_scale, false);
pSound->SetParam("ammo", ammo, false);
//Sound variations for FY71 (AI most common weapon)
if(m_pShared->fireparams.sound_variation && !m_pWeapon->IsOwnerFP())
{
pSound->SetParam("variations", m_soundVariationParam, true);
}
}
if (m_speed >= m_pShared->rapidparams.min_speed)
{
m_spinUpSoundId = INVALID_SOUNDID;
}
}
}
else if (m_soundId != INVALID_SOUNDID)
{
m_pWeapon->StopSound(m_soundId);
m_soundId = INVALID_SOUNDID;
}
}