mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Checks for emptyString in preload
Sound asset out for emptyString
This commit is contained in:
parent
4429de59b0
commit
76addc52eb
6 changed files with 44 additions and 11 deletions
|
|
@ -235,6 +235,8 @@ public: \
|
||||||
m##name = NULL;\
|
m##name = NULL;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
if(get##name() == StringTable->EmptyString())\
|
||||||
|
return true;\
|
||||||
if (m##name##Asset.notNull() && m##name##Asset->getStatus() != SoundAsset::Ok)\
|
if (m##name##Asset.notNull() && m##name##Asset->getStatus() != SoundAsset::Ok)\
|
||||||
{\
|
{\
|
||||||
Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\
|
Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\
|
||||||
|
|
|
||||||
|
|
@ -864,7 +864,15 @@ bool ExplosionData::preload(bool server, String &errorStr)
|
||||||
|
|
||||||
if( !server )
|
if( !server )
|
||||||
{
|
{
|
||||||
String sfxErrorStr;
|
|
||||||
|
if (getSound() != StringTable->EmptyString())
|
||||||
|
{
|
||||||
|
_setSound(getSound());
|
||||||
|
|
||||||
|
if (!getSoundProfile())
|
||||||
|
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||||
|
}
|
||||||
|
|
||||||
if (!particleEmitter && particleEmitterId != 0)
|
if (!particleEmitter && particleEmitterId != 0)
|
||||||
if (Sim::findObject(particleEmitterId, particleEmitter) == false)
|
if (Sim::findObject(particleEmitterId, particleEmitter) == false)
|
||||||
Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock");
|
Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock");
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ bool LightningData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
for (S32 i = 0; i < MaxThunders; i++)
|
for (S32 i = 0; i < MaxThunders; i++)
|
||||||
{
|
{
|
||||||
if (getThunderSound(i))
|
if (getThunderSound(i) != StringTable->EmptyString())
|
||||||
{
|
{
|
||||||
_setThunderSound(getThunderSound(i), i);
|
_setThunderSound(getThunderSound(i), i);
|
||||||
Con::printf("Thunder sound: %d %s", i, getThunderSound(i));
|
Con::printf("Thunder sound: %d %s", i, getThunderSound(i));
|
||||||
|
|
@ -308,8 +308,13 @@ bool LightningData::preload(bool server, String &errorStr)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getStrikeSound() && !getStrikeSoundProfile())
|
if (getStrikeSound() != StringTable->EmptyString())
|
||||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset");
|
{
|
||||||
|
_setStrikeSound(getStrikeSound());
|
||||||
|
|
||||||
|
if(!getStrikeSoundProfile())
|
||||||
|
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from strike sound.");
|
||||||
|
}
|
||||||
|
|
||||||
mNumStrikeTextures = 0;
|
mNumStrikeTextures = 0;
|
||||||
for (U32 k = 0; k < MaxTextures; k++)
|
for (U32 k = 0; k < MaxTextures; k++)
|
||||||
|
|
|
||||||
|
|
@ -188,9 +188,16 @@ 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)
|
||||||
|
{
|
||||||
|
if (getSound() != StringTable->EmptyString())
|
||||||
|
{
|
||||||
|
_setSound(getSound());
|
||||||
|
|
||||||
if (!server && !getSoundProfile())
|
if (!getSoundProfile())
|
||||||
return false;
|
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -276,11 +276,17 @@ 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 && !getSoundProfile())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!server)
|
if (!server)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (getSound() != StringTable->EmptyString())
|
||||||
|
{
|
||||||
|
_setSound(getSound());
|
||||||
|
|
||||||
|
if(!getSoundProfile())
|
||||||
|
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||||
|
}
|
||||||
|
|
||||||
S32 i;
|
S32 i;
|
||||||
for( i=0; i<NUM_EMITTERS; i++ )
|
for( i=0; i<NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -367,8 +367,13 @@ bool ProjectileData::preload(bool server, String &errorStr)
|
||||||
if (Sim::findObject(decalId, decal) == false)
|
if (Sim::findObject(decalId, decal) == false)
|
||||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
|
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
|
||||||
|
|
||||||
if( !getProjectileSound() )
|
if (getProjectileSound() != StringTable->EmptyString())
|
||||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid asset");
|
{
|
||||||
|
_setProjectileSound(getProjectileSound());
|
||||||
|
|
||||||
|
if (!getProjectileSoundProfile())
|
||||||
|
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||||
|
}
|
||||||
|
|
||||||
if (!lightDesc && lightDescId != 0)
|
if (!lightDesc && lightDescId != 0)
|
||||||
if (Sim::findObject(lightDescId, lightDesc) == false)
|
if (Sim::findObject(lightDescId, lightDesc) == false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue