|
@@ -127,7 +127,7 @@ ConsoleDocClass( PrecipitationData,
|
|
//----------------------------------------------------------
|
|
//----------------------------------------------------------
|
|
PrecipitationData::PrecipitationData()
|
|
PrecipitationData::PrecipitationData()
|
|
{
|
|
{
|
|
- soundProfile = NULL;
|
|
|
|
|
|
+ INIT_SOUNDASSET(Sound);
|
|
|
|
|
|
INIT_IMAGEASSET(Drop);
|
|
INIT_IMAGEASSET(Drop);
|
|
|
|
|
|
@@ -143,8 +143,7 @@ PrecipitationData::PrecipitationData()
|
|
|
|
|
|
void PrecipitationData::initPersistFields()
|
|
void PrecipitationData::initPersistFields()
|
|
{
|
|
{
|
|
- addField( "soundProfile", TYPEID< SFXTrack >(), Offset(soundProfile, PrecipitationData),
|
|
|
|
- "Looping SFXProfile effect to play while Precipitation is active." );
|
|
|
|
|
|
+ INITPERSISTFIELD_SOUNDASSET(Sound, PrecipitationData, "Looping SFXProfile effect to play while Precipitation is active.");
|
|
|
|
|
|
addProtectedField( "dropTexture", TypeFilename, Offset(mDropName, PrecipitationData), &_setDropData, &defaultProtectedGetFn,
|
|
addProtectedField( "dropTexture", TypeFilename, Offset(mDropName, PrecipitationData), &_setDropData, &defaultProtectedGetFn,
|
|
"@brief Texture filename for drop particles.\n\n"
|
|
"@brief Texture filename for drop particles.\n\n"
|
|
@@ -190,7 +189,7 @@ 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 && !sfxResolve( &soundProfile, errorStr ) )
|
|
|
|
|
|
+ if (!server && (mSoundAsset.isNull() || !mSoundAsset->getSfxProfile()))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
return true;
|
|
return true;
|
|
@@ -200,7 +199,8 @@ void PrecipitationData::packData(BitStream* stream)
|
|
{
|
|
{
|
|
Parent::packData(stream);
|
|
Parent::packData(stream);
|
|
|
|
|
|
- sfxWrite( stream, soundProfile );
|
|
|
|
|
|
+ PACKDATA_SOUNDASSET(Sound);
|
|
|
|
+ //sfxWrite( stream, soundProfile );
|
|
|
|
|
|
PACKDATA_IMAGEASSET(Drop);
|
|
PACKDATA_IMAGEASSET(Drop);
|
|
|
|
|
|
@@ -217,7 +217,8 @@ void PrecipitationData::unpackData(BitStream* stream)
|
|
{
|
|
{
|
|
Parent::unpackData(stream);
|
|
Parent::unpackData(stream);
|
|
|
|
|
|
- sfxRead( stream, &soundProfile );
|
|
|
|
|
|
+ UNPACKDATA_SOUNDASSET(Sound);
|
|
|
|
+ //sfxRead( stream, &soundProfile );
|
|
|
|
|
|
UNPACKDATA_IMAGEASSET(Drop);
|
|
UNPACKDATA_IMAGEASSET(Drop);
|
|
|
|
|
|
@@ -598,9 +599,9 @@ bool Precipitation::onNewDataBlock( GameBaseData *dptr, bool reload )
|
|
{
|
|
{
|
|
SFX_DELETE( mAmbientSound );
|
|
SFX_DELETE( mAmbientSound );
|
|
|
|
|
|
- if ( mDataBlock->soundProfile )
|
|
|
|
|
|
+ if ( mDataBlock->mSoundAsset && mDataBlock->mSoundAsset->getSfxProfile() )
|
|
{
|
|
{
|
|
- mAmbientSound = SFX->createSource( mDataBlock->soundProfile, &getTransform() );
|
|
|
|
|
|
+ mAmbientSound = SFX->createSource(mDataBlock->mSoundAsset->getSfxProfile(), &getTransform() );
|
|
if ( mAmbientSound )
|
|
if ( mAmbientSound )
|
|
mAmbientSound->play();
|
|
mAmbientSound->play();
|
|
}
|
|
}
|