mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
standardize soundasset preloading for datablocks
This commit is contained in:
parent
6c8dfdbe4c
commit
15f7f04bee
13 changed files with 46 additions and 58 deletions
|
|
@ -877,15 +877,10 @@ bool ExplosionData::preload(bool server, String &errorStr)
|
|||
if( !server )
|
||||
{
|
||||
|
||||
if (getSound() != StringTable->EmptyString())
|
||||
if (getSound() != StringTable->EmptyString() && !isSoundValid())
|
||||
{
|
||||
_setSound(getSound());
|
||||
|
||||
if (!getSoundProfile())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||
return false;
|
||||
}
|
||||
Con::errorf(ConsoleLogEntry::General, "ExplosionData::preload: Invalid Sound asset.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!particleEmitter && particleEmitterId != 0)
|
||||
|
|
|
|||
|
|
@ -297,19 +297,17 @@ bool LightningData::preload(bool server, String &errorStr)
|
|||
{
|
||||
for (S32 i = 0; i < MaxThunders; i++)
|
||||
{
|
||||
_setThunderSound(getThunderSound(i), i);
|
||||
if (isThunderSoundValid(i) && !getThunderSoundProfile(i))
|
||||
if (getThunderSound(i) != StringTable->EmptyString() && !isThunderSoundValid(i))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder.");
|
||||
|
||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid ThunderSound asset.");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_setStrikeSound(getStrikeSound());
|
||||
if (isStrikeSoundValid() && !getStrikeSoundProfile())
|
||||
if (getStrikeSound() != StringTable->EmptyString() && !isStrikeSoundValid())
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from strike sound.");
|
||||
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid StrikeSound asset.");
|
||||
return false;
|
||||
}
|
||||
|
||||
mNumStrikeTextures = 0;
|
||||
|
|
|
|||
|
|
@ -191,12 +191,10 @@ bool PrecipitationData::preload( bool server, String &errorStr )
|
|||
return false;
|
||||
if (!server)
|
||||
{
|
||||
if (getSound() != StringTable->EmptyString())
|
||||
if (getSound() != StringTable->EmptyString() && !isSoundValid())
|
||||
{
|
||||
_setSound(getSound());
|
||||
|
||||
if (!getSoundProfile())
|
||||
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||
Con::errorf(ConsoleLogEntry::General, "PrecipitationData::preload: Invalid Sound asset.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -279,13 +279,10 @@ bool SplashData::preload(bool server, String &errorStr)
|
|||
|
||||
if (!server)
|
||||
{
|
||||
|
||||
if (getSound() != StringTable->EmptyString())
|
||||
if (getSound() != StringTable->EmptyString() && !isSoundValid())
|
||||
{
|
||||
_setSound(getSound());
|
||||
|
||||
if(!getSoundProfile())
|
||||
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
|
||||
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Invalid Sound asset.");
|
||||
return false;
|
||||
}
|
||||
|
||||
S32 i;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue