MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onAdd

Method onAdd

Engine/source/sfx/sfxDescription.cpp:445–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443//-----------------------------------------------------------------------------
444
445bool SFXDescription::onAdd()
446{
447 if ( !Parent::onAdd() )
448 return false;
449
450 Sim::getSFXDescriptionSet()->addObject( this );
451
452 // Convert a legacy 'channel' field, if we have one.
453
454 static const char* sChannel = StringTable->insert( "channel" );
455 const char* channelValue = getDataField( sChannel, NULL );
456 if( channelValue && channelValue[ 0 ] )
457 {
458 ConsoleValue result = Con::evaluatef( "return sfxOldChannelToGroup( %s );", channelValue );
459 const char* group = result.getString();
460 if( !Sim::findObject( group, mSourceGroup ) )
461 Con::errorf( "SFXDescription::onAdd - could not resolve channel '%s' to SFXSource", channelValue );
462 }
463
464 // Validate the data we'll be passing to
465 // the audio layer.
466 validate();
467
468 return true;
469}
470
471//-----------------------------------------------------------------------------
472

Callers

nothing calls this directly

Calls 7

evaluatefFunction · 0.85
validateFunction · 0.85
findObjectFunction · 0.50
errorfFunction · 0.50
addObjectMethod · 0.45
insertMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected