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

Method onAdd

Engine/source/sfx/sfxTrack.cpp:164–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162//-----------------------------------------------------------------------------
163
164bool SFXTrack::onAdd()
165{
166 if( !Parent::onAdd() )
167 return false;
168
169 // If we have no SFXDescription, try to grab a default.
170
171 if( !mDescription )
172 {
173 if( !Sim::findObject( "AudioEffects", mDescription ) && Sim::getSFXDescriptionSet()->size() > 0 )
174 mDescription = dynamic_cast< SFXDescription* >( Sim::getSFXDescriptionSet()->at( 0 ) );
175
176 if( !mDescription )
177 {
178 Con::errorf(
179 "SFXTrack(%s)::onAdd: The profile is missing a description!",
180 getName() );
181 return false;
182 }
183 }
184
185 Sim::getSFXTrackSet()->addObject( this );
186
187 return true;
188}
189
190//-----------------------------------------------------------------------------
191

Callers

nothing calls this directly

Calls 6

findObjectFunction · 0.50
errorfFunction · 0.50
getNameFunction · 0.50
sizeMethod · 0.45
atMethod · 0.45
addObjectMethod · 0.45

Tested by

no test coverage detected