本文整理汇总了C++中SoundInstance::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundInstance::Copy方法的具体用法?C++ SoundInstance::Copy怎么用?C++ SoundInstance::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundInstance
的用法示例。
在下文中一共展示了SoundInstance::Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TriggerEvent
void SoundSystem::TriggerEvent( char *_type, char *_eventName, Vector3<float> const &_pos )
{
if( !m_channels ) return;
START_PROFILE("TriggerEvent");
SoundEventBlueprint *seb = m_blueprints.GetBlueprint(_type);
if( seb )
{
for( int i = 0; i < seb->m_events.Size(); ++i )
{
SoundInstanceBlueprint *sib = seb->m_events[i];
if( stricmp( sib->m_eventName, _eventName ) == 0 )
{
SoundInstance *instance = new SoundInstance();
instance->Copy( sib->m_instance );
instance->m_pos = _pos;
bool success = InitialiseSound ( instance );
if( !success ) ShutdownSound ( instance );
}
}
}
END_PROFILE("TriggerEvent");
}
示例2: TriggerDuplicateSound
void SoundSystem::TriggerDuplicateSound ( SoundInstance *_instance )
{
SoundInstance *newInstance = new SoundInstance();
newInstance->Copy( _instance );
newInstance->m_parent = _instance->m_parent;
newInstance->m_pos = _instance->m_pos;
newInstance->m_vel = _instance->m_vel;
for( int i = 0; i < _instance->m_objIds.Size(); ++i )
{
SoundObjectId id = *_instance->m_objIds.GetPointer(i);
newInstance->m_objIds.PutData( id );
}
bool success = InitialiseSound( newInstance );
if( success && newInstance->m_positionType == SoundInstance::TypeInEditor )
{
m_editorInstanceId = newInstance->m_id;
}
else if( !success )
{
ShutdownSound( newInstance);
}
}