mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
cleanups for sound assets
removed redundant get<foo>Profile calls, correctly used a few in proxmine
This commit is contained in:
parent
3c30a905c3
commit
93faa243ac
11 changed files with 25 additions and 81 deletions
|
|
@ -426,8 +426,8 @@ void ProximityMine::processTick( const Move* move )
|
||||||
mAnimThread = mShapeInstance->addThread();
|
mAnimThread = mShapeInstance->addThread();
|
||||||
mShapeInstance->setSequence( mAnimThread, mDataBlock->armingSequence, 0.0f );
|
mShapeInstance->setSequence( mAnimThread, mDataBlock->armingSequence, 0.0f );
|
||||||
}
|
}
|
||||||
if ( mDataBlock->getArmSound() )
|
if ( mDataBlock->getArmSoundProfile() )
|
||||||
SFX->playOnce( mDataBlock->getArmSoundAsset()->getSfxProfile(), &getRenderTransform() );
|
SFX->playOnce( mDataBlock->getArmSoundProfile(), &getRenderTransform() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -467,8 +467,8 @@ void ProximityMine::processTick( const Move* move )
|
||||||
mAnimThread = mShapeInstance->addThread();
|
mAnimThread = mShapeInstance->addThread();
|
||||||
mShapeInstance->setSequence( mAnimThread, mDataBlock->triggerSequence, 0.0f );
|
mShapeInstance->setSequence( mAnimThread, mDataBlock->triggerSequence, 0.0f );
|
||||||
}
|
}
|
||||||
if ( mDataBlock->getTriggerSound() )
|
if ( mDataBlock->getTriggerSoundProfile() )
|
||||||
SFX->playOnce( mDataBlock->getTriggerSoundAsset()->getSfxProfile(), &getRenderTransform() );
|
SFX->playOnce( mDataBlock->getTriggerSoundProfile(), &getRenderTransform() );
|
||||||
|
|
||||||
if ( isServerObject() )
|
if ( isServerObject() )
|
||||||
mDataBlock->onTriggered_callback( this, sql.mList[0] );
|
mDataBlock->onTriggered_callback( this, sql.mList[0] );
|
||||||
|
|
|
||||||
|
|
@ -1172,27 +1172,27 @@ void RigidShape::updatePos(F32 dt)
|
||||||
if (collSpeed >= mDataBlock->softImpactSpeed)
|
if (collSpeed >= mDataBlock->softImpactSpeed)
|
||||||
impactSound = RigidShapeData::Body::SoftImpactSound;
|
impactSound = RigidShapeData::Body::SoftImpactSound;
|
||||||
|
|
||||||
if (impactSound != -1 && mDataBlock->getBodySounds(impactSound) != NULL)
|
if (impactSound != -1 && mDataBlock->getBodySoundsProfile(impactSound))
|
||||||
SFX->playOnce(mDataBlock->getBodySoundProfile(impactSound), &getTransform());
|
SFX->playOnce(mDataBlock->getBodySoundsProfile(impactSound), &getTransform());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Water volume sounds
|
// Water volume sounds
|
||||||
F32 vSpeed = getVelocity().len();
|
F32 vSpeed = getVelocity().len();
|
||||||
if (!inLiquid && mWaterCoverage >= 0.8f) {
|
if (!inLiquid && mWaterCoverage >= 0.8f) {
|
||||||
if (vSpeed >= mDataBlock->hardSplashSoundVel)
|
if (vSpeed >= mDataBlock->hardSplashSoundVel)
|
||||||
SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ImpactHard), &getTransform());
|
SFX->playOnce(mDataBlock->getWaterSoundsProfile(RigidShapeData::ImpactHard), &getTransform());
|
||||||
else
|
else
|
||||||
if (vSpeed >= mDataBlock->medSplashSoundVel)
|
if (vSpeed >= mDataBlock->medSplashSoundVel)
|
||||||
SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ImpactMedium), &getTransform());
|
SFX->playOnce(mDataBlock->getWaterSoundsProfile(RigidShapeData::ImpactMedium), &getTransform());
|
||||||
else
|
else
|
||||||
if (vSpeed >= mDataBlock->softSplashSoundVel)
|
if (vSpeed >= mDataBlock->softSplashSoundVel)
|
||||||
SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ImpactSoft), &getTransform());
|
SFX->playOnce(mDataBlock->getWaterSoundsProfile(RigidShapeData::ImpactSoft), &getTransform());
|
||||||
inLiquid = true;
|
inLiquid = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (inLiquid && mWaterCoverage < 0.8f) {
|
if (inLiquid && mWaterCoverage < 0.8f) {
|
||||||
if (vSpeed >= mDataBlock->exitSplashSoundVel)
|
if (vSpeed >= mDataBlock->exitSplashSoundVel)
|
||||||
SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ExitWater), &getTransform());
|
SFX->playOnce(mDataBlock->getWaterSoundsProfile(RigidShapeData::ExitWater), &getTransform());
|
||||||
inLiquid = false;
|
inLiquid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,6 @@ class RigidShapeData : public ShapeBaseData
|
||||||
DECLARE_SOUNDASSET_ARRAY(RigidShapeData, BodySounds, Body::Sounds::MaxSounds)
|
DECLARE_SOUNDASSET_ARRAY(RigidShapeData, BodySounds, Body::Sounds::MaxSounds)
|
||||||
DECLARE_ASSET_ARRAY_SETGET(RigidShapeData, BodySounds);
|
DECLARE_ASSET_ARRAY_SETGET(RigidShapeData, BodySounds);
|
||||||
|
|
||||||
SFXProfile* getBodySoundProfile(U32 id)
|
|
||||||
{
|
|
||||||
if (mBodySoundsAsset[id] != NULL)
|
|
||||||
return mBodySoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum RigidShapeConsts
|
enum RigidShapeConsts
|
||||||
{
|
{
|
||||||
VC_NUM_DUST_EMITTERS = 1,
|
VC_NUM_DUST_EMITTERS = 1,
|
||||||
|
|
@ -94,14 +86,6 @@ class RigidShapeData : public ShapeBaseData
|
||||||
DECLARE_SOUNDASSET_ARRAY(RigidShapeData, WaterSounds, Sounds::MaxSounds)
|
DECLARE_SOUNDASSET_ARRAY(RigidShapeData, WaterSounds, Sounds::MaxSounds)
|
||||||
DECLARE_ASSET_ARRAY_SETGET(RigidShapeData, WaterSounds);
|
DECLARE_ASSET_ARRAY_SETGET(RigidShapeData, WaterSounds);
|
||||||
|
|
||||||
SFXProfile* getWaterSoundProfile(U32 id)
|
|
||||||
{
|
|
||||||
if (mWaterSoundsAsset[id] != NULL)
|
|
||||||
return mWaterSoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
F32 exitSplashSoundVel;
|
F32 exitSplashSoundVel;
|
||||||
F32 softSplashSoundVel;
|
F32 softSplashSoundVel;
|
||||||
F32 medSplashSoundVel;
|
F32 medSplashSoundVel;
|
||||||
|
|
|
||||||
|
|
@ -367,10 +367,10 @@ bool FlyingVehicle::onNewDataBlock(GameBaseData* dptr, bool reload)
|
||||||
SFX_DELETE( mEngineSound );
|
SFX_DELETE( mEngineSound );
|
||||||
|
|
||||||
if ( mDataBlock->getFlyingSounds(FlyingVehicleData::EngineSound) )
|
if ( mDataBlock->getFlyingSounds(FlyingVehicleData::EngineSound) )
|
||||||
mEngineSound = SFX->createSource( mDataBlock->getFlyingSoundProfile(FlyingVehicleData::EngineSound), &getTransform() );
|
mEngineSound = SFX->createSource( mDataBlock->getFlyingSoundsProfile(FlyingVehicleData::EngineSound), &getTransform() );
|
||||||
|
|
||||||
if ( mDataBlock->getFlyingSounds(FlyingVehicleData::JetSound))
|
if ( mDataBlock->getFlyingSounds(FlyingVehicleData::JetSound))
|
||||||
mJetSound = SFX->createSource( mDataBlock->getFlyingSoundProfile(FlyingVehicleData::JetSound), &getTransform() );
|
mJetSound = SFX->createSource( mDataBlock->getFlyingSoundsProfile(FlyingVehicleData::JetSound), &getTransform() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Jet Sequences
|
// Jet Sequences
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,6 @@ struct FlyingVehicleData: public VehicleData {
|
||||||
};
|
};
|
||||||
DECLARE_SOUNDASSET_ARRAY(FlyingVehicleData, FlyingSounds, Sounds::MaxSounds);
|
DECLARE_SOUNDASSET_ARRAY(FlyingVehicleData, FlyingSounds, Sounds::MaxSounds);
|
||||||
DECLARE_ASSET_ARRAY_SETGET(FlyingVehicleData, FlyingSounds);
|
DECLARE_ASSET_ARRAY_SETGET(FlyingVehicleData, FlyingSounds);
|
||||||
SFXProfile* getFlyingSoundProfile(U32 id)
|
|
||||||
{
|
|
||||||
if (mFlyingSoundsAsset[id] != NULL)
|
|
||||||
return mFlyingSoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum Jets {
|
enum Jets {
|
||||||
// These enums index into a static name list.
|
// These enums index into a static name list.
|
||||||
|
|
|
||||||
|
|
@ -543,13 +543,13 @@ bool HoverVehicle::onNewDataBlock(GameBaseData* dptr, bool reload)
|
||||||
SFX_DELETE( mJetSound );
|
SFX_DELETE( mJetSound );
|
||||||
|
|
||||||
if ( mDataBlock->getHoverSounds(HoverVehicleData::EngineSound) )
|
if ( mDataBlock->getHoverSounds(HoverVehicleData::EngineSound) )
|
||||||
mEngineSound = SFX->createSource( mDataBlock->getHoverSoundProfile(HoverVehicleData::EngineSound), &getTransform() );
|
mEngineSound = SFX->createSource( mDataBlock->getHoverSoundsProfile(HoverVehicleData::EngineSound), &getTransform() );
|
||||||
|
|
||||||
if ( !mDataBlock->getHoverSounds(HoverVehicleData::FloatSound) )
|
if ( !mDataBlock->getHoverSounds(HoverVehicleData::FloatSound) )
|
||||||
mFloatSound = SFX->createSource( mDataBlock->getHoverSoundProfile(HoverVehicleData::FloatSound), &getTransform() );
|
mFloatSound = SFX->createSource( mDataBlock->getHoverSoundsProfile(HoverVehicleData::FloatSound), &getTransform() );
|
||||||
|
|
||||||
if ( mDataBlock->getHoverSounds(HoverVehicleData::JetSound) )
|
if ( mDataBlock->getHoverSounds(HoverVehicleData::JetSound) )
|
||||||
mJetSound = SFX->createSource( mDataBlock->getHoverSoundProfile(HoverVehicleData::JetSound), &getTransform() );
|
mJetSound = SFX->createSource( mDataBlock->getHoverSoundsProfile(HoverVehicleData::JetSound), &getTransform() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo: Uncomment if this is a "leaf" class
|
// Todo: Uncomment if this is a "leaf" class
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,6 @@ class HoverVehicleData : public VehicleData
|
||||||
MaxSounds
|
MaxSounds
|
||||||
};
|
};
|
||||||
DECLARE_SOUNDASSET_ARRAY(HoverVehicleData, HoverSounds, Sounds::MaxSounds);
|
DECLARE_SOUNDASSET_ARRAY(HoverVehicleData, HoverSounds, Sounds::MaxSounds);
|
||||||
SFXProfile* getHoverSoundProfile(U32 id)
|
|
||||||
{
|
|
||||||
if (mHoverSoundsAsset[id] != NULL)
|
|
||||||
return mHoverSoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum Jets {
|
enum Jets {
|
||||||
// These enums index into a static name list.
|
// These enums index into a static name list.
|
||||||
|
|
|
||||||
|
|
@ -893,7 +893,7 @@ bool Vehicle::onNewDataBlock(GameBaseData* dptr,bool reload)
|
||||||
SFX_DELETE( mWakeSound );
|
SFX_DELETE( mWakeSound );
|
||||||
|
|
||||||
if ( mDataBlock->getVehicleWaterSounds(VehicleData::Wake) != NULL )
|
if ( mDataBlock->getVehicleWaterSounds(VehicleData::Wake) != NULL )
|
||||||
mWakeSound = SFX->createSource( mDataBlock->getVehicleWaterSoundProfile(VehicleData::Wake), &getTransform() );
|
mWakeSound = SFX->createSource( mDataBlock->getVehicleWaterSoundsProfile(VehicleData::Wake), &getTransform() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1156,27 +1156,27 @@ void Vehicle::updatePos(F32 dt)
|
||||||
if (collSpeed >= mDataBlock->softImpactSpeed)
|
if (collSpeed >= mDataBlock->softImpactSpeed)
|
||||||
impactSound = VehicleData::Body::SoftImpactSound;
|
impactSound = VehicleData::Body::SoftImpactSound;
|
||||||
|
|
||||||
if (impactSound != -1 && mDataBlock->getVehicleBodySounds(impactSound) != NULL)
|
if (impactSound != -1 && mDataBlock->getVehicleBodySoundsProfile(impactSound) != NULL)
|
||||||
SFX->playOnce( mDataBlock->getVehicleBodySoundProfile(impactSound), &getTransform() );
|
SFX->playOnce( mDataBlock->getVehicleBodySoundsProfile(impactSound), &getTransform() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Water volume sounds
|
// Water volume sounds
|
||||||
F32 vSpeed = getVelocity().len();
|
F32 vSpeed = getVelocity().len();
|
||||||
if (!inLiquid && mWaterCoverage >= 0.8f) {
|
if (!inLiquid && mWaterCoverage >= 0.8f) {
|
||||||
if (vSpeed >= mDataBlock->hardSplashSoundVel)
|
if (vSpeed >= mDataBlock->hardSplashSoundVel)
|
||||||
SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ImpactHard), &getTransform() );
|
SFX->playOnce( mDataBlock->getVehicleWaterSoundsProfile(VehicleData::ImpactHard), &getTransform() );
|
||||||
else
|
else
|
||||||
if (vSpeed >= mDataBlock->medSplashSoundVel)
|
if (vSpeed >= mDataBlock->medSplashSoundVel)
|
||||||
SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ImpactMedium), &getTransform() );
|
SFX->playOnce( mDataBlock->getVehicleWaterSoundsProfile(VehicleData::ImpactMedium), &getTransform() );
|
||||||
else
|
else
|
||||||
if (vSpeed >= mDataBlock->softSplashSoundVel)
|
if (vSpeed >= mDataBlock->softSplashSoundVel)
|
||||||
SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ImpactSoft), &getTransform() );
|
SFX->playOnce( mDataBlock->getVehicleWaterSoundsProfile(VehicleData::ImpactSoft), &getTransform() );
|
||||||
inLiquid = true;
|
inLiquid = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(inLiquid && mWaterCoverage < 0.8f) {
|
if(inLiquid && mWaterCoverage < 0.8f) {
|
||||||
if (vSpeed >= mDataBlock->exitSplashSoundVel)
|
if (vSpeed >= mDataBlock->exitSplashSoundVel)
|
||||||
SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ExitWater), &getTransform() );
|
SFX->playOnce( mDataBlock->getVehicleWaterSoundsProfile(VehicleData::ExitWater), &getTransform() );
|
||||||
inLiquid = false;
|
inLiquid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,15 +51,6 @@ struct VehicleData : public RigidShapeData
|
||||||
|
|
||||||
DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleBodySounds, Body::Sounds::MaxSounds)
|
DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleBodySounds, Body::Sounds::MaxSounds)
|
||||||
|
|
||||||
SFXProfile* getVehicleBodySoundProfile(U32 id)
|
|
||||||
{
|
|
||||||
if (mVehicleBodySoundsAsset[id] != NULL)
|
|
||||||
return mVehicleBodySoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
enum VehicleConsts
|
enum VehicleConsts
|
||||||
{
|
{
|
||||||
VC_NUM_DUST_EMITTERS = 1,
|
VC_NUM_DUST_EMITTERS = 1,
|
||||||
|
|
@ -82,14 +73,6 @@ struct VehicleData : public RigidShapeData
|
||||||
|
|
||||||
DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleWaterSounds, Sounds::MaxSounds)
|
DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleWaterSounds, Sounds::MaxSounds)
|
||||||
|
|
||||||
SFXProfile* getVehicleWaterSoundProfile(U32 id)
|
|
||||||
{
|
|
||||||
if (mVehicleWaterSoundsAsset[id] != NULL)
|
|
||||||
return mVehicleWaterSoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
F32 exitSplashSoundVel;
|
F32 exitSplashSoundVel;
|
||||||
F32 softSplashSoundVel;
|
F32 softSplashSoundVel;
|
||||||
F32 medSplashSoundVel;
|
F32 medSplashSoundVel;
|
||||||
|
|
|
||||||
|
|
@ -686,13 +686,13 @@ bool WheeledVehicle::onNewDataBlock(GameBaseData* dptr, bool reload)
|
||||||
SFX_DELETE( mJetSound );
|
SFX_DELETE( mJetSound );
|
||||||
|
|
||||||
if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::EngineSound) )
|
if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::EngineSound) )
|
||||||
mEngineSound = SFX->createSource( mDataBlock->getWheeledVehicleSound(WheeledVehicleData::EngineSound), &getTransform() );
|
mEngineSound = SFX->createSource( mDataBlock->getWheeledVehicleSoundsProfile(WheeledVehicleData::EngineSound), &getTransform() );
|
||||||
|
|
||||||
if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::SquealSound) )
|
if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::SquealSound) )
|
||||||
mSquealSound = SFX->createSource( mDataBlock->getWheeledVehicleSound(WheeledVehicleData::SquealSound), &getTransform() );
|
mSquealSound = SFX->createSource( mDataBlock->getWheeledVehicleSoundsProfile(WheeledVehicleData::SquealSound), &getTransform() );
|
||||||
|
|
||||||
if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::JetSound) )
|
if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::JetSound) )
|
||||||
mJetSound = SFX->createSource( mDataBlock->getWheeledVehicleSound(WheeledVehicleData::JetSound), &getTransform() );
|
mJetSound = SFX->createSource( mDataBlock->getWheeledVehicleSoundsProfile(WheeledVehicleData::JetSound), &getTransform() );
|
||||||
}
|
}
|
||||||
|
|
||||||
scriptOnNewDataBlock();
|
scriptOnNewDataBlock();
|
||||||
|
|
|
||||||
|
|
@ -121,15 +121,6 @@ struct WheeledVehicleData: public VehicleData
|
||||||
|
|
||||||
DECLARE_SOUNDASSET_ARRAY(WheeledVehicleData, WheeledVehicleSounds, Sounds::MaxSounds);
|
DECLARE_SOUNDASSET_ARRAY(WheeledVehicleData, WheeledVehicleSounds, Sounds::MaxSounds);
|
||||||
|
|
||||||
SFXProfile* getWheeledVehicleSound(U32 id)
|
|
||||||
{
|
|
||||||
if (mWheeledVehicleSoundsAsset[id] != NULL)
|
|
||||||
return mWheeledVehicleSoundsAsset[id]->getSfxProfile();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ParticleEmitterData* tireEmitter;
|
ParticleEmitterData* tireEmitter;
|
||||||
|
|
||||||
F32 maxWheelSpeed; // Engine torque is scale based on wheel speed
|
F32 maxWheelSpeed; // Engine torque is scale based on wheel speed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue