本文整理汇总了C++中ISound::IsInitialized方法的典型用法代码示例。如果您正苦于以下问题:C++ ISound::IsInitialized方法的具体用法?C++ ISound::IsInitialized怎么用?C++ ISound::IsInitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISound
的用法示例。
在下文中一共展示了ISound::IsInitialized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ISound* CCE3SoundWrapper::GetPreferredSound()
{
// Return last preferred sound if he is still consistent, else search a new one
ISound* pPreferredSound = NULL;
ISound* pFallbackSound = NULL; // better then nothing...
// last preferred source still there?
if ( gEnv && gEnv->pSoundSystem )
{
pPreferredSound = gEnv->pSoundSystem->GetSound( m_nPreferredDataSource );
}
// is his playback state still consistent?
if ( pPreferredSound && pPreferredSound->IsLoaded() && pPreferredSound->IsInitialized() && PLAYSTATE_CONSISTENT( pPreferredSound ) )
{
goto success;
}
// If not the check the 2d sound
if ( Is2DSoundActive() && PLAYSTATE_CONSISTENT( m_p2DSound ) )
{
m_nPreferredDataSource = m_p2DSound->GetId();
pPreferredSound = m_p2DSound;
goto success;
}
pFallbackSound = m_p2DSound; // better then nothing...
// Or one from the proxies
for ( tEntitySoundProxyMap::iterator iterSound = m_SoundProxies.begin(); iterSound != m_SoundProxies.end(); ++iterSound )
{
if ( iterSound->second.IsActive() && PLAYSTATE_CONSISTENT( iterSound->second.GetSound() ) )
{
pPreferredSound = iterSound->second.GetSound();
m_nPreferredDataSource = pPreferredSound->GetId();
goto success;
}
// better then nothing...
if ( !pFallbackSound && iterSound->second.IsExisting() )
{
pFallbackSound = iterSound->second.GetSound();
}
}
// if nothing reliable was found
m_nPreferredDataSource = INVALID_SOUNDID;
if ( pFallbackSound )
{
return pFallbackSound;
}
return NULL;
success:
// RefreshMaxDuration( pPreferredSound );
return pPreferredSound;
}