Converts precipitationData to use sound asset macros

Adds handling for soundProfile fields and lookups of sound assets by SFXProfile name in project importer
This commit is contained in:
Areloch 2021-09-15 00:41:23 -05:00
parent 328319b853
commit 17d1253ba2
4 changed files with 58 additions and 28 deletions

View file

@ -34,8 +34,9 @@
#endif
#include "T3D/assets/ImageAsset.h"
#include "T3D/assets/SoundAsset.h"
class SFXTrack;
//class SFXTrack;
class SFXSource;
//--------------------------------------------------------------------------
@ -45,30 +46,32 @@ class PrecipitationData : public GameBaseData
typedef GameBaseData Parent;
public:
SFXTrack* soundProfile;
//SFXTrack* soundProfile;
DECLARE_SOUNDASSET(PrecipitationData, Sound);
DECLARE_SOUNDASSET_SETGET(PrecipitationData, Sound);
DECLARE_IMAGEASSET(PrecipitationData, Drop, onDropChanged, GFXStaticTextureSRGBProfile); ///< Texture for drop particles
DECLARE_IMAGEASSET_SETGET(PrecipitationData, Drop);
DECLARE_IMAGEASSET(PrecipitationData, Drop, onDropChanged, GFXStaticTextureSRGBProfile); ///< Texture for drop particles
DECLARE_IMAGEASSET_SETGET(PrecipitationData, Drop);
StringTableEntry mDropShaderName; ///< The name of the shader used for raindrops
StringTableEntry mDropShaderName; ///< The name of the shader used for raindrops
DECLARE_IMAGEASSET(PrecipitationData, Splash, onSplashChanged, GFXStaticTextureSRGBProfile); ///< Texture for splash particles
DECLARE_IMAGEASSET_SETGET(PrecipitationData, Splash);
DECLARE_IMAGEASSET(PrecipitationData, Splash, onSplashChanged, GFXStaticTextureSRGBProfile); ///< Texture for splash particles
DECLARE_IMAGEASSET_SETGET(PrecipitationData, Splash);
StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops
StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops
S32 mDropsPerSide; ///< How many drops are on a side of the raindrop texture.
S32 mSplashesPerSide; ///< How many splash are on a side of the splash texture.
S32 mDropsPerSide; ///< How many drops are on a side of the raindrop texture.
S32 mSplashesPerSide; ///< How many splash are on a side of the splash texture.
PrecipitationData();
DECLARE_CONOBJECT(PrecipitationData);
bool preload( bool server, String& errorStr );
static void initPersistFields();
virtual void packData(BitStream* stream);
virtual void unpackData(BitStream* stream);
PrecipitationData();
DECLARE_CONOBJECT(PrecipitationData);
bool preload( bool server, String& errorStr );
static void initPersistFields();
virtual void packData(BitStream* stream);
virtual void unpackData(BitStream* stream);
void onDropChanged() {}
void onSplashChanged() {}
void onDropChanged() {}
void onSplashChanged() {}
};
struct Raindrop