SoundAsset Refactor

This commit is contained in:
marauder2k7 2025-12-12 12:27:33 +00:00
parent 9f29bee45f
commit da40838560
61 changed files with 1333 additions and 1828 deletions

View file

@ -127,8 +127,6 @@ ConsoleDocClass( PrecipitationData,
//----------------------------------------------------------
PrecipitationData::PrecipitationData()
{
INIT_ASSET(Sound);
mDropShaderName = StringTable->EmptyString();
mSplashShaderName = StringTable->EmptyString();
@ -175,7 +173,7 @@ bool PrecipitationData::preload( bool server, String &errorStr )
return false;
if (!server)
{
if (!isSoundValid())
if (!getSoundSFXTrack())
{
//return false; -TODO: trigger asset download
}
@ -188,7 +186,7 @@ void PrecipitationData::packData(BitStream* stream)
{
Parent::packData(stream);
PACKDATA_ASSET(Sound);
PACKDATA_ASSET_REFACTOR(Sound);
PACKDATA_ASSET_REFACTOR(Drop);
@ -205,7 +203,7 @@ void PrecipitationData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_ASSET(Sound);
UNPACKDATA_ASSET_REFACTOR(Sound);
UNPACKDATA_ASSET_REFACTOR(Drop);
@ -587,9 +585,9 @@ bool Precipitation::onNewDataBlock( GameBaseData *dptr, bool reload )
{
SFX_DELETE( mAmbientSound );
if ( mDataBlock->getSoundProfile())
if ( mDataBlock->getSoundSFXTrack())
{
mAmbientSound = SFX->createSource(mDataBlock->getSoundProfile(), &getTransform() );
mAmbientSound = SFX->createSource(mDataBlock->getSoundSFXTrack(), &getTransform() );
if ( mAmbientSound )
mAmbientSound->play();
}