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

Method onNewDataBlock

Engine/source/T3D/projectile.cpp:877–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

875
876
877bool Projectile::onNewDataBlock( GameBaseData *dptr, bool reload )
878{
879 mDataBlock = dynamic_cast<ProjectileData*>( dptr );
880 if ( !mDataBlock || !Parent::onNewDataBlock( dptr, reload ) )
881 return false;
882
883 if ( isGhost() )
884 {
885 // Create the sound ahead of time. This reduces runtime
886 // costs and makes the system easier to understand.
887
888 SFX_DELETE( mSound );
889
890 if ( mDataBlock->getProjectileSound() )
891 mSound = SFX->createSource( mDataBlock->getProjectileSoundProfile() );
892 }
893
894 return true;
895}
896
897void Projectile::submitLights( LightManager *lm, bool staticLighting )
898{

Callers 3

onAddMethod · 0.45
emitParticlesMethod · 0.45
explodeMethod · 0.45

Calls 1

createSourceMethod · 0.45

Tested by

no test coverage detected