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

Method onAdd

Engine/source/sfx/sfxParameter.cpp:188–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186//-----------------------------------------------------------------------------
187
188bool SFXParameter::onAdd()
189{
190 if( !Parent::onAdd() )
191 return false;
192
193 mValue = mDefaultValue;
194
195 // Make sure the parameter has a name.
196
197 if( !getInternalName() || !getInternalName()[ 0 ] )
198 {
199 Con::errorf( "SFXParameter::onAdd - %i (%s): parameter object does not have a name", getId(), getName() );
200 return false;
201 }
202
203 // Make sure the parameter has a unique name.
204
205 if( find( getInternalName() ) )
206 {
207 Con::errorf( "SFXParameter::onAdd - %i (%s): a parameter called '%s' already exists", getId(), getName(), getInternalName() );
208 return false;
209 }
210
211 // Add us to the SFXParameter group.
212
213 Sim::getSFXParameterGroup()->addObject( this );
214
215 return true;
216}
217
218//-----------------------------------------------------------------------------
219

Callers

nothing calls this directly

Calls 4

errorfFunction · 0.50
getNameFunction · 0.50
findFunction · 0.50
addObjectMethod · 0.45

Tested by

no test coverage detected