Browse Source

cleanups for sound assets
removed redundant get<foo>Profile calls, correctly used a few in proxmine

AzaezelX 3 years ago
parent
commit
93faa243ac

+ 4 - 4
Engine/source/T3D/proximityMine.cpp

@@ -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() )
-                  SFX->playOnce( mDataBlock->getArmSoundAsset()->getSfxProfile(), &getRenderTransform() );
+               if ( mDataBlock->getArmSoundProfile() )
+                  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() )
-                  SFX->playOnce( mDataBlock->getTriggerSoundAsset()->getSfxProfile(), &getRenderTransform() );
+               if ( mDataBlock->getTriggerSoundProfile() )
+                  SFX->playOnce( mDataBlock->getTriggerSoundProfile(), &getRenderTransform() );
 
 
                if ( isServerObject() )
                if ( isServerObject() )
                   mDataBlock->onTriggered_callback( this, sql.mList[0] );
                   mDataBlock->onTriggered_callback( this, sql.mList[0] );

+ 6 - 6
Engine/source/T3D/rigidShape.cpp

@@ -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)
-            SFX->playOnce(mDataBlock->getBodySoundProfile(impactSound), &getTransform());
+         if (impactSound != -1 && mDataBlock->getBodySoundsProfile(impactSound))
+            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;
          }
          }
    }
    }

+ 0 - 16
Engine/source/T3D/rigidShape.h

@@ -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;

+ 2 - 2
Engine/source/T3D/vehicles/flyingVehicle.cpp

@@ -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

+ 0 - 7
Engine/source/T3D/vehicles/flyingVehicle.h

@@ -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.

+ 3 - 3
Engine/source/T3D/vehicles/hoverVehicle.cpp

@@ -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

+ 0 - 7
Engine/source/T3D/vehicles/hoverVehicle.h

@@ -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.

+ 7 - 7
Engine/source/T3D/vehicles/vehicle.cpp

@@ -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)
-            SFX->playOnce( mDataBlock->getVehicleBodySoundProfile(impactSound), &getTransform() );
+         if (impactSound != -1 && mDataBlock->getVehicleBodySoundsProfile(impactSound) != NULL)
+            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;
       }
       }
    }
    }

+ 0 - 17
Engine/source/T3D/vehicles/vehicle.h

@@ -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;

+ 3 - 3
Engine/source/T3D/vehicles/wheeledVehicle.cpp

@@ -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();

+ 0 - 9
Engine/source/T3D/vehicles/wheeledVehicle.h

@@ -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