mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
QOC
Code cleaning of unnecessary else' Remove unnecessary dynamic_casts
This commit is contained in:
parent
e9d0f68b55
commit
57aceb60fb
13 changed files with 33 additions and 28 deletions
|
|
@ -1382,7 +1382,7 @@ bool Explosion::explode()
|
||||||
resetWorldBox();
|
resetWorldBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
SFXProfile* sound_prof = dynamic_cast<SFXProfile*>(mDataBlock->getSFXProfile());
|
SFXProfile* sound_prof = mDataBlock->getSFXProfile();
|
||||||
if (sound_prof)
|
if (sound_prof)
|
||||||
{
|
{
|
||||||
soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index);
|
soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index);
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class ExplosionData : public GameBaseData {
|
||||||
SFXProfile* getSFXProfile() {
|
SFXProfile* getSFXProfile() {
|
||||||
if (mSoundAsset.notNull())
|
if (mSoundAsset.notNull())
|
||||||
return mSoundAsset->getSfxProfile();
|
return mSoundAsset->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,9 @@ LightningData::LightningData()
|
||||||
INIT_SOUNDASSET(StrikeSound);
|
INIT_SOUNDASSET(StrikeSound);
|
||||||
|
|
||||||
for (S32 i = 0; i < MaxThunders; i++)
|
for (S32 i = 0; i < MaxThunders; i++)
|
||||||
|
{
|
||||||
INIT_SOUNDASSET_ARRAY(ThunderSound, MaxThunders);
|
INIT_SOUNDASSET_ARRAY(ThunderSound, MaxThunders);
|
||||||
|
}
|
||||||
|
|
||||||
for (S32 i = 0; i < MaxTextures; i++)
|
for (S32 i = 0; i < MaxTextures; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -97,14 +97,14 @@ class LightningData : public GameBaseData
|
||||||
{
|
{
|
||||||
if (mThunderSoundAsset[id] != NULL)
|
if (mThunderSoundAsset[id] != NULL)
|
||||||
return mThunderSoundAsset[id]->getSfxProfile();
|
return mThunderSoundAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SFXProfile* getSFXProfile() {
|
SFXProfile* getSFXProfile() {
|
||||||
if (mStrikeSoundAsset.notNull())
|
if (mStrikeSoundAsset.notNull())
|
||||||
return mStrikeSoundAsset->getSfxProfile();
|
return mStrikeSoundAsset->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ class PrecipitationData : public GameBaseData
|
||||||
SFXProfile* getSFXProfile() {
|
SFXProfile* getSFXProfile() {
|
||||||
if (mSoundAsset.notNull())
|
if (mSoundAsset.notNull())
|
||||||
return mSoundAsset->getSfxProfile();
|
return mSoundAsset->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,9 @@ SplashData::SplashData()
|
||||||
|
|
||||||
U32 i;
|
U32 i;
|
||||||
for (i = 0; i < NUM_TEX; i++)
|
for (i = 0; i < NUM_TEX; i++)
|
||||||
|
{
|
||||||
INIT_IMAGEASSET_ARRAY(Texture, i);
|
INIT_IMAGEASSET_ARRAY(Texture, i);
|
||||||
|
}
|
||||||
|
|
||||||
for( i=0; i<NUM_TIME_KEYS; i++ )
|
for( i=0; i<NUM_TIME_KEYS; i++ )
|
||||||
times[i] = 1.0;
|
times[i] = 1.0;
|
||||||
|
|
@ -679,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 = dynamic_cast<SFXProfile*>(mDataBlock->getSFXProfile());
|
SFXProfile* sound_prof = mDataBlock->getSFXProfile();
|
||||||
if (sound_prof)
|
if (sound_prof)
|
||||||
{
|
{
|
||||||
SFX->playOnce(sound_prof, &getTransform());
|
SFX->playOnce(sound_prof, &getTransform());
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ public:
|
||||||
SFXProfile* getSFXProfile() {
|
SFXProfile* getSFXProfile() {
|
||||||
if (mSoundAsset.notNull())
|
if (mSoundAsset.notNull())
|
||||||
return mSoundAsset->getSfxProfile();
|
return mSoundAsset->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,10 +118,11 @@ public:
|
||||||
|
|
||||||
DECLARE_SOUNDASSET(ProjectileData, ProjectileSound);
|
DECLARE_SOUNDASSET(ProjectileData, ProjectileSound);
|
||||||
DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound);
|
DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound);
|
||||||
|
|
||||||
SFXProfile* getSFXProfile() {
|
SFXProfile* getSFXProfile() {
|
||||||
if (mProjectileSoundAsset.notNull())
|
if (mProjectileSoundAsset.notNull())
|
||||||
return mProjectileSoundAsset->getSfxProfile();
|
return mProjectileSoundAsset->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class RigidShapeData : public ShapeBaseData
|
||||||
{
|
{
|
||||||
if (mBodySoundsAsset[id] != NULL)
|
if (mBodySoundsAsset[id] != NULL)
|
||||||
return mBodySoundsAsset[id]->getSfxProfile();
|
return mBodySoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ class RigidShapeData : public ShapeBaseData
|
||||||
{
|
{
|
||||||
if (mWaterSoundsAsset[id] != NULL)
|
if (mWaterSoundsAsset[id] != NULL)
|
||||||
return mWaterSoundsAsset[id]->getSfxProfile();
|
return mWaterSoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ struct FlyingVehicleData: public VehicleData {
|
||||||
{
|
{
|
||||||
if (mFlyingSoundsAsset[id] != NULL)
|
if (mFlyingSoundsAsset[id] != NULL)
|
||||||
return mFlyingSoundsAsset[id]->getSfxProfile();
|
return mFlyingSoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class HoverVehicleData : public VehicleData
|
||||||
{
|
{
|
||||||
if (mHoverSoundsAsset[id] != NULL)
|
if (mHoverSoundsAsset[id] != NULL)
|
||||||
return mHoverSoundsAsset[id]->getSfxProfile();
|
return mHoverSoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ struct VehicleData : public RigidShapeData
|
||||||
{
|
{
|
||||||
if (mVehicleBodySoundsAsset[id] != NULL)
|
if (mVehicleBodySoundsAsset[id] != NULL)
|
||||||
return mVehicleBodySoundsAsset[id]->getSfxProfile();
|
return mVehicleBodySoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ struct VehicleData : public RigidShapeData
|
||||||
{
|
{
|
||||||
if (mVehicleWaterSoundsAsset[id] != NULL)
|
if (mVehicleWaterSoundsAsset[id] != NULL)
|
||||||
return mVehicleWaterSoundsAsset[id]->getSfxProfile();
|
return mVehicleWaterSoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ struct WheeledVehicleData: public VehicleData
|
||||||
{
|
{
|
||||||
if (mWheeledVehicleSoundsAsset[id] != NULL)
|
if (mWheeledVehicleSoundsAsset[id] != NULL)
|
||||||
return mWheeledVehicleSoundsAsset[id]->getSfxProfile();
|
return mWheeledVehicleSoundsAsset[id]->getSfxProfile();
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue