mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 22:10:36 +00:00
sound safeties and future notes
This commit is contained in:
parent
39b9b47caf
commit
c4ae6258cc
15 changed files with 39 additions and 48 deletions
|
|
@ -264,7 +264,7 @@ public: \
|
|||
return m##name##Desc;}\
|
||||
return NULL;\
|
||||
}\
|
||||
bool is##name##Valid() { return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); }
|
||||
bool is##name##Valid() { return (get##name() != StringTable->EmptyString() && m##name##Asset && m##name##Asset->getStatus() == AssetBase::Ok); }
|
||||
|
||||
#ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ public: \
|
|||
return m##name##Asset[id]->getSfxProfile();\
|
||||
return NULL;\
|
||||
}\
|
||||
bool is##name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok); }
|
||||
bool is##name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id] && m##name##Asset[id]->getStatus() == AssetBase::Ok); }
|
||||
|
||||
|
||||
#ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
|
||||
|
|
|
|||
|
|
@ -877,10 +877,9 @@ bool ExplosionData::preload(bool server, String &errorStr)
|
|||
if( !server )
|
||||
{
|
||||
|
||||
if (getSound() != StringTable->EmptyString() && !isSoundValid())
|
||||
if (!isSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ExplosionData::preload: Invalid Sound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
if (!particleEmitter && particleEmitterId != 0)
|
||||
|
|
|
|||
|
|
@ -297,17 +297,15 @@ bool LightningData::preload(bool server, String &errorStr)
|
|||
{
|
||||
for (S32 i = 0; i < MaxThunders; i++)
|
||||
{
|
||||
if (getThunderSound(i) != StringTable->EmptyString() && !isThunderSoundValid(i))
|
||||
if (!isThunderSoundValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid ThunderSound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
}
|
||||
if (getStrikeSound() != StringTable->EmptyString() && !isStrikeSoundValid())
|
||||
if (!isStrikeSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid StrikeSound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
mNumStrikeTextures = 0;
|
||||
|
|
|
|||
|
|
@ -191,10 +191,9 @@ bool PrecipitationData::preload( bool server, String &errorStr )
|
|||
return false;
|
||||
if (!server)
|
||||
{
|
||||
if (getSound() != StringTable->EmptyString() && !isSoundValid())
|
||||
if (!isSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "PrecipitationData::preload: Invalid Sound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -279,10 +279,10 @@ bool SplashData::preload(bool server, String &errorStr)
|
|||
|
||||
if (!server)
|
||||
{
|
||||
if (getSound() != StringTable->EmptyString() && !isSoundValid())
|
||||
if (!isSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Invalid Sound asset.");
|
||||
return false;
|
||||
//return false;
|
||||
}
|
||||
|
||||
S32 i;
|
||||
|
|
|
|||
|
|
@ -471,10 +471,9 @@ bool PlayerData::preload(bool server, String &errorStr)
|
|||
if (!server) {
|
||||
for (U32 i = 0; i < MaxSounds; ++i)
|
||||
{
|
||||
if (getPlayerSound(i) != StringTable->EmptyString() && !isPlayerSoundValid(i))
|
||||
if (!isPlayerSoundValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ExplosionData::preload: Invalid PlayerSound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -368,10 +368,9 @@ bool ProjectileData::preload(bool server, String &errorStr)
|
|||
if (Sim::findObject(decalId, decal) == false)
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
|
||||
|
||||
if (getProjectileSound() != StringTable->EmptyString() && !isProjectileSoundValid())
|
||||
if (!isProjectileSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid ProjectileSound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
if (!lightDesc && lightDescId != 0)
|
||||
|
|
|
|||
|
|
@ -134,10 +134,14 @@ bool ProximityMineData::preload( bool server, String& errorStr )
|
|||
|
||||
if ( !server )
|
||||
{
|
||||
if( !getArmSound() )
|
||||
Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid arming sound." );
|
||||
if( !getTriggerSound() )
|
||||
Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid trigger sound." );
|
||||
if(!isArmSoundValid() )
|
||||
{
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
if(!isTriggerSoundValid() )
|
||||
{
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
|
||||
if ( mShape )
|
||||
|
|
|
|||
|
|
@ -318,19 +318,17 @@ bool RigidShapeData::preload(bool server, String &errorStr)
|
|||
if (!server) {
|
||||
for (S32 i = 0; i < Body::MaxSounds; i++)
|
||||
{
|
||||
if (getBodySounds(i) != StringTable->EmptyString() && !isBodySoundsValid(i))
|
||||
if (!isBodySoundsValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "RigidShapeData::preload: Invalid BodySound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
|
||||
for (S32 j = 0; j < Sounds::MaxSounds; j++)
|
||||
{
|
||||
if (getWaterSounds(j) != StringTable->EmptyString() && !isWaterSoundsValid(j))
|
||||
if (!isWaterSoundsValid(j))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "RigidShapeData::preload: Invalid WaterSound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -422,10 +422,9 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
|
|||
if (!Sim::findObject(SimObjectId((uintptr_t)state[i].emitter), state[i].emitter))
|
||||
Con::errorf(ConsoleLogEntry::General, "Error, unable to load emitter for image datablock");
|
||||
|
||||
if (getstateSound(i) != StringTable->EmptyString() && !isstateSoundValid(i))
|
||||
if (!isstateSoundValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ShapeBaseImageData::preload: Invalid stateSound asset %s on state %d", getstateSound(i), i);
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ bool FlyingVehicleData::preload(bool server, String &errorStr)
|
|||
if (!server) {
|
||||
for (S32 i = 0; i < MaxSounds; i++)
|
||||
{
|
||||
if (getFlyingSounds(i) != StringTable->EmptyString() && !isFlyingSoundsValid(i))
|
||||
if (!isFlyingSoundsValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "FlyingVehicleData::preload: Invalid FlyingSounds asset.");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -315,10 +315,9 @@ bool HoverVehicleData::preload(bool server, String &errorStr)
|
|||
|
||||
for (S32 i = 0; i < MaxSounds; i++)
|
||||
{
|
||||
if (getHoverSounds(i) != StringTable->EmptyString() && !isHoverSoundsValid(i))
|
||||
if (!isHoverSoundsValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "HoverVehicleData::preload: Invalid HoverSounds asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
for (S32 j = 0; j < MaxJetEmitters; j++)
|
||||
|
|
|
|||
|
|
@ -348,10 +348,9 @@ bool WheeledVehicleData::preload(bool server, String &errorStr)
|
|||
if (!server) {
|
||||
for (S32 i = 0; i < MaxSounds; i++)
|
||||
{
|
||||
if (getWheeledVehicleSounds(i) != StringTable->EmptyString() && !isWheeledVehicleSoundsValid(i))
|
||||
if (!isWheeledVehicleSoundsValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "HoverVehicleData::preload: Invalid WheeledVehicleSounds asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -517,10 +517,9 @@ bool afxMagicMissileData::preload(bool server, String &errorStr)
|
|||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
|
||||
*/
|
||||
|
||||
if (getProjectileSound() != StringTable->EmptyString() && !isProjectileSoundValid())
|
||||
if (!isProjectileSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid ProjectileSound asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
if (!lightDesc && lightDescId != 0)
|
||||
|
|
|
|||
|
|
@ -153,10 +153,9 @@ bool SFXAmbience::preload( bool server, String& errorStr )
|
|||
if( !sfxResolve( &mEnvironment, errorStr ) )
|
||||
return false;
|
||||
|
||||
if (getSoundTrack() != StringTable->EmptyString() && !isSoundTrackValid())
|
||||
if (!isSoundTrackValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "SFXAmbience::preload: Invalid SoundTrack asset.");
|
||||
return false;
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
for( U32 i = 0; i < MaxStates; ++ i )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue