mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
clean out of the manual getSFXProfile() methods
This commit is contained in:
parent
7b137c2ee8
commit
ef652ad8b9
8 changed files with 8 additions and 37 deletions
|
|
@ -859,7 +859,7 @@ bool ExplosionData::preload(bool server, String &errorStr)
|
||||||
if (Parent::preload(server, errorStr) == false)
|
if (Parent::preload(server, errorStr) == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!server && !getSFXProfile())
|
if (!server && !getSoundProfile())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !server )
|
if( !server )
|
||||||
|
|
@ -1382,7 +1382,7 @@ bool Explosion::explode()
|
||||||
resetWorldBox();
|
resetWorldBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
SFXProfile* sound_prof = mDataBlock->getSFXProfile();
|
SFXProfile* sound_prof = mDataBlock->getSoundProfile();
|
||||||
if (sound_prof)
|
if (sound_prof)
|
||||||
{
|
{
|
||||||
soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index);
|
soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index);
|
||||||
|
|
|
||||||
|
|
@ -73,13 +73,6 @@ class ExplosionData : public GameBaseData {
|
||||||
DECLARE_SOUNDASSET(ExplosionData, Sound);
|
DECLARE_SOUNDASSET(ExplosionData, Sound);
|
||||||
DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound);
|
DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound);
|
||||||
|
|
||||||
SFXProfile* getSFXProfile() {
|
|
||||||
if (mSoundAsset.notNull())
|
|
||||||
return mSoundAsset->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ParticleEmitterData* particleEmitter;
|
ParticleEmitterData* particleEmitter;
|
||||||
S32 particleEmitterId;
|
S32 particleEmitterId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ bool PrecipitationData::preload( bool server, String &errorStr )
|
||||||
if( Parent::preload( server, errorStr) == false)
|
if( Parent::preload( server, errorStr) == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!server && !getSFXProfile())
|
if (!server && !getSoundProfile())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -597,9 +597,9 @@ bool Precipitation::onNewDataBlock( GameBaseData *dptr, bool reload )
|
||||||
{
|
{
|
||||||
SFX_DELETE( mAmbientSound );
|
SFX_DELETE( mAmbientSound );
|
||||||
|
|
||||||
if ( mDataBlock->getSFXProfile())
|
if ( mDataBlock->getSoundProfile())
|
||||||
{
|
{
|
||||||
mAmbientSound = SFX->createSource(mDataBlock->getSFXProfile(), &getTransform() );
|
mAmbientSound = SFX->createSource(mDataBlock->getSoundProfile(), &getTransform() );
|
||||||
if ( mAmbientSound )
|
if ( mAmbientSound )
|
||||||
mAmbientSound->play();
|
mAmbientSound->play();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,13 +71,6 @@ class PrecipitationData : public GameBaseData
|
||||||
|
|
||||||
void onDropChanged() {}
|
void onDropChanged() {}
|
||||||
void onSplashChanged() {}
|
void onSplashChanged() {}
|
||||||
|
|
||||||
SFXProfile* getSFXProfile() {
|
|
||||||
if (mSoundAsset.notNull())
|
|
||||||
return mSoundAsset->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Raindrop
|
struct Raindrop
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ bool SplashData::preload(bool server, String &errorStr)
|
||||||
if (Parent::preload(server, errorStr) == false)
|
if (Parent::preload(server, errorStr) == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!server && !getSFXProfile())
|
if (!server && !getSoundProfile())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!server)
|
if (!server)
|
||||||
|
|
@ -681,7 +681,7 @@ void Splash::spawnExplosion()
|
||||||
|
|
||||||
/// could just play the explosion one, but explosion could be weapon specific,
|
/// could just play the explosion one, but explosion could be weapon specific,
|
||||||
/// splash sound could be liquid specific. food for thought.
|
/// splash sound could be liquid specific. food for thought.
|
||||||
SFXProfile* sound_prof = mDataBlock->getSFXProfile();
|
SFXProfile* sound_prof = mDataBlock->getSoundProfile();
|
||||||
if (sound_prof)
|
if (sound_prof)
|
||||||
{
|
{
|
||||||
SFX->playOnce(sound_prof, &getTransform());
|
SFX->playOnce(sound_prof, &getTransform());
|
||||||
|
|
|
||||||
|
|
@ -98,14 +98,6 @@ public:
|
||||||
DECLARE_SOUNDASSET(SplashData, Sound);
|
DECLARE_SOUNDASSET(SplashData, Sound);
|
||||||
DECLARE_SOUNDASSET_SETGET(SplashData, Sound);
|
DECLARE_SOUNDASSET_SETGET(SplashData, Sound);
|
||||||
|
|
||||||
/// this should probably be added as a function higher up to stop repeats.
|
|
||||||
SFXProfile* getSFXProfile() {
|
|
||||||
if (mSoundAsset.notNull())
|
|
||||||
return mSoundAsset->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ParticleEmitterData* emitterList[NUM_EMITTERS];
|
ParticleEmitterData* emitterList[NUM_EMITTERS];
|
||||||
S32 emitterIDList[NUM_EMITTERS];
|
S32 emitterIDList[NUM_EMITTERS];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -882,7 +882,7 @@ bool Projectile::onNewDataBlock( GameBaseData *dptr, bool reload )
|
||||||
SFX_DELETE( mSound );
|
SFX_DELETE( mSound );
|
||||||
|
|
||||||
if ( mDataBlock->getProjectileSound() )
|
if ( mDataBlock->getProjectileSound() )
|
||||||
mSound = SFX->createSource( mDataBlock->getSFXProfile() );
|
mSound = SFX->createSource( mDataBlock->getProjectileSoundProfile() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -118,13 +118,6 @@ public:
|
||||||
|
|
||||||
DECLARE_SOUNDASSET(ProjectileData, ProjectileSound);
|
DECLARE_SOUNDASSET(ProjectileData, ProjectileSound);
|
||||||
DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound);
|
DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound);
|
||||||
|
|
||||||
SFXProfile* getSFXProfile() {
|
|
||||||
if (mProjectileSoundAsset.notNull())
|
|
||||||
return mProjectileSoundAsset->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
LightDescription *lightDesc;
|
LightDescription *lightDesc;
|
||||||
S32 lightDescId;
|
S32 lightDescId;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue