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

Method onAdd

Engine/source/sfx/sfxDescription.cpp:448–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected