code duplication prune. should aid in stability

This commit is contained in:
AzaezelX 2021-10-03 02:56:26 -05:00
parent 10f2453cee
commit 98a079a797
123 changed files with 632 additions and 966 deletions

View file

@ -230,7 +230,7 @@ ExplosionData::ExplosionData()
faceViewer = false;
INIT_SOUNDASSET(Sound);
INIT_ASSET(Sound);
//soundProfile = NULL;
particleEmitter = NULL;
@ -239,7 +239,7 @@ ExplosionData::ExplosionData()
explosionScale.set(1.0f, 1.0f, 1.0f);
playSpeed = 1.0f;
INIT_SHAPEASSET(ExplosionShape);
INIT_ASSET(ExplosionShape);
explosionAnimation = -1;
@ -310,12 +310,12 @@ ExplosionData::ExplosionData(const ExplosionData& other, bool temp_clone) : Game
faceViewer = other.faceViewer;
particleDensity = other.particleDensity;
particleRadius = other.particleRadius;
CLONE_SOUNDASSET(Sound);
CLONE_ASSET(Sound);
particleEmitter = other.particleEmitter;
particleEmitterId = other.particleEmitterId; // -- for pack/unpack of particleEmitter ptr
explosionScale = other.explosionScale;
playSpeed = other.playSpeed;
CLONE_SHAPEASSET(ExplosionShape);
CLONE_ASSET(ExplosionShape);
explosionAnimation = other.explosionAnimation; // -- from explosionShape sequence "ambient"
dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) );
dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs
@ -650,9 +650,9 @@ void ExplosionData::packData(BitStream* stream)
{
Parent::packData(stream);
PACKDATA_SHAPEASSET(ExplosionShape);
PACKDATA_ASSET(ExplosionShape);
PACKDATA_SOUNDASSET(Sound);
PACKDATA_ASSET(Sound);
if (stream->writeFlag(particleEmitter))
stream->writeRangedU32(particleEmitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast);
@ -754,9 +754,9 @@ void ExplosionData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_SHAPEASSET(ExplosionShape);
UNPACKDATA_ASSET(ExplosionShape);
UNPACKDATA_SOUNDASSET(Sound);
UNPACKDATA_ASSET(Sound);
if (stream->readFlag())
particleEmitterId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);

View file

@ -71,7 +71,7 @@ class ExplosionData : public GameBaseData {
F32 particleRadius;
DECLARE_SOUNDASSET(ExplosionData, Sound);
DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound);
DECLARE_ASSET_SETGET(ExplosionData, Sound);
ParticleEmitterData* particleEmitter;
S32 particleEmitterId;
@ -80,7 +80,7 @@ class ExplosionData : public GameBaseData {
F32 playSpeed;
DECLARE_SHAPEASSET(ExplosionData, ExplosionShape, onShapeChanged);
DECLARE_SHAPEASSET_SETGET(ExplosionData, ExplosionShape);
DECLARE_ASSET_SETGET(ExplosionData, ExplosionShape);
S32 explosionAnimation;

View file

@ -459,7 +459,7 @@ GroundCover::GroundCover()
mRandomSeed = 1;
INIT_MATERIALASSET(Material);
INIT_ASSET(Material);
mMaterialInst = NULL;
mMatParams = NULL;
@ -520,7 +520,7 @@ GroundCover::GroundCover()
mBillboardRects[i].point.set( 0.0f, 0.0f );
mBillboardRects[i].extent.set( 1.0f, 1.0f );
INIT_SHAPEASSET_ARRAY(Shape, i);
INIT_ASSET_ARRAY(Shape, i);
mShapeInstances[i] = NULL;
@ -713,7 +713,7 @@ U32 GroundCover::packUpdate( NetConnection *connection, U32 mask, BitStream *str
// TODO: We could probably optimize a few of these
// based on reasonable units at some point.
PACK_MATERIALASSET(connection, Material);
PACK_ASSET(connection, Material);
stream->write( mRadius );
stream->write( mZOffset );
@ -766,7 +766,7 @@ U32 GroundCover::packUpdate( NetConnection *connection, U32 mask, BitStream *str
stream->write( mBillboardRects[i].extent.x );
stream->write( mBillboardRects[i].extent.y );
PACK_SHAPEASSET_ARRAY(connection, Shape, i);
PACK_ASSET_ARRAY(connection, Shape, i);
}
stream->writeFlag( mDebugRenderCells );
@ -784,7 +784,7 @@ void GroundCover::unpackUpdate( NetConnection *connection, BitStream *stream )
if (stream->readFlag())
{
UNPACK_MATERIALASSET(connection, Material);
UNPACK_ASSET(connection, Material);
stream->read( &mRadius );
stream->read( &mZOffset );
@ -837,7 +837,7 @@ void GroundCover::unpackUpdate( NetConnection *connection, BitStream *stream )
stream->read( &mBillboardRects[i].extent.x );
stream->read( &mBillboardRects[i].extent.y );
UNPACK_SHAPEASSET_ARRAY(connection, Shape, i);
UNPACK_ASSET_ARRAY(connection, Shape, i);
}
mDebugRenderCells = stream->readFlag();

View file

@ -269,7 +269,7 @@ protected:
BaseMatInstance* mMaterialInst;
DECLARE_MATERIALASSET(GroundCover, Material);
DECLARE_MATERIALASSET_NET_SETGET(GroundCover, Material, InitialUpdateMask);
DECLARE_ASSET_NET_SETGET(GroundCover, Material, InitialUpdateMask);
GroundCoverShaderConstData mShaderConstData;
@ -341,7 +341,7 @@ protected:
/// The cover shape filenames.
DECLARE_SHAPEASSET_ARRAY(GroundCover, Shape, MAX_COVERTYPES);
DECLARE_SHAPEASSET_ARRAY_NET_SETGET(GroundCover, Shape, -1);
DECLARE_ASSET_ARRAY_NET_SETGET(GroundCover, Shape, -1);
/// The cover shape instances.
TSShapeInstance* mShapeInstances[MAX_COVERTYPES];

View file

@ -238,11 +238,11 @@ void LightningStrikeEvent::process(NetConnection*)
//
LightningData::LightningData()
{
INIT_SOUNDASSET(StrikeSound);
INIT_ASSET(StrikeSound);
for (S32 i = 0; i < MaxThunders; i++)
{
INIT_SOUNDASSET_ARRAY(ThunderSound, i);
INIT_ASSET_ARRAY(ThunderSound, i);
}
for (S32 i = 0; i < MaxTextures; i++)
@ -335,7 +335,7 @@ void LightningData::packData(BitStream* stream)
U32 i;
for (i = 0; i < MaxThunders; i++)
{
PACKDATA_SOUNDASSET_ARRAY(ThunderSound, i);
PACKDATA_ASSET_ARRAY(ThunderSound, i);
}
stream->writeInt(mNumStrikeTextures, 4);
@ -343,7 +343,7 @@ void LightningData::packData(BitStream* stream)
for (i = 0; i < MaxTextures; i++)
stream->writeString(strikeTextureNames[i]);
PACKDATA_SOUNDASSET(StrikeSound);
PACKDATA_ASSET(StrikeSound);
}
void LightningData::unpackData(BitStream* stream)
@ -353,7 +353,7 @@ void LightningData::unpackData(BitStream* stream)
U32 i;
for (i = 0; i < MaxThunders; i++)
{
UNPACKDATA_SOUNDASSET_ARRAY(ThunderSound, i);
UNPACKDATA_ASSET_ARRAY(ThunderSound, i);
}
mNumStrikeTextures = stream->readInt(4);
@ -361,7 +361,7 @@ void LightningData::unpackData(BitStream* stream)
for (i = 0; i < MaxTextures; i++)
strikeTextureNames[i] = stream->readSTString();
UNPACKDATA_SOUNDASSET(StrikeSound);
UNPACKDATA_ASSET(StrikeSound);
}

View file

@ -65,10 +65,10 @@ class LightningData : public GameBaseData
public:
DECLARE_SOUNDASSET_ARRAY(LightningData, ThunderSound, MaxThunders);
DECLARE_SOUNDASSET_ARRAY_SETGET(LightningData, ThunderSound);
DECLARE_ASSET_ARRAY_SETGET(LightningData, ThunderSound);
DECLARE_SOUNDASSET(LightningData, StrikeSound);
DECLARE_SOUNDASSET_SETGET(LightningData, StrikeSound);
DECLARE_ASSET_SETGET(LightningData, StrikeSound);
StringTableEntry strikeTextureNames[MaxTextures];

View file

@ -122,8 +122,8 @@ ParticleData::ParticleData()
animTexFramesString = NULL; // string of animation frame indices
animTexUVs = NULL; // array of tile vertex UVs
INIT_IMAGEASSET(Texture);
INIT_IMAGEASSET(TextureExt);
INIT_ASSET(Texture);
INIT_ASSET(TextureExt);
constrain_pos = false;
start_angle = 0.0f;
@ -293,7 +293,7 @@ void ParticleData::packData(BitStream* stream)
stream->writeFloat( times[i], 8);
}
//PACKDATA_IMAGEASSET(Texture);
//PACKDATA_ASSET(Texture);
for (i = 0; i < 4; i++)
mathWrite(*stream, texCoords[i]);
@ -307,7 +307,7 @@ void ParticleData::packData(BitStream* stream)
stream->writeInt(framesPerSec, 8);
}
//PACKDATA_IMAGEASSET(TextureExt);
//PACKDATA_ASSET(TextureExt);
stream->writeFlag(constrain_pos);
stream->writeFloat(start_angle/360.0f, 11);
@ -378,7 +378,7 @@ void ParticleData::unpackData(BitStream* stream)
times[i] = stream->readFloat(8);
}
//UNPACKDATA_IMAGEASSET(Texture);
//UNPACKDATA_ASSET(Texture);
for (i = 0; i < 4; i++)
mathRead(*stream, &texCoords[i]);
@ -391,7 +391,7 @@ void ParticleData::unpackData(BitStream* stream)
framesPerSec = stream->readInt(8);
}
//UNPACKDATA_IMAGEASSET(Texture);
//UNPACKDATA_ASSET(Texture);
constrain_pos = stream->readFlag();
start_angle = 360.0f*stream->readFloat(11);
@ -763,12 +763,12 @@ ParticleData::ParticleData(const ParticleData& other, bool temp_clone) : SimData
animTexFramesString = other.animTexFramesString;
animTexFrames = other.animTexFrames; // -- parsed from animTexFramesString
CLONE_IMAGEASSET(Texture);
CLONE_ASSET(Texture);
spinBias = other.spinBias;
randomizeSpinDir = other.randomizeSpinDir;
CLONE_IMAGEASSET(TextureExt);
CLONE_ASSET(TextureExt);
constrain_pos = other.constrain_pos;
start_angle = other.start_angle;
@ -804,4 +804,4 @@ void ParticleData::onPerformSubstitutions()
reload(errorBuffer);
}
DEF_IMAGEASSET_BINDS(ParticleData, Texture);
DEF_ASSET_BINDS(ParticleData, Texture);

View file

@ -87,7 +87,7 @@ class ParticleData : public SimDataBlock
Vector<U8> animTexFrames;
DECLARE_IMAGEASSET(ParticleData, Texture, onImageChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(ParticleData, Texture);
DECLARE_ASSET_SETGET(ParticleData, Texture);
static bool protectedSetSizes(void* object, const char* index, const char* data);
static bool protectedSetTimes(void* object, const char* index, const char* data);
@ -118,7 +118,7 @@ public:
bool randomizeSpinDir;
public:
DECLARE_IMAGEASSET(ParticleData, TextureExt, onImageChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(ParticleData, TextureExt);
DECLARE_ASSET_SETGET(ParticleData, TextureExt);
bool constrain_pos;
F32 start_angle;

View file

@ -127,13 +127,13 @@ ConsoleDocClass( PrecipitationData,
//----------------------------------------------------------
PrecipitationData::PrecipitationData()
{
INIT_SOUNDASSET(Sound);
INIT_ASSET(Sound);
INIT_IMAGEASSET(Drop);
INIT_ASSET(Drop);
mDropShaderName = StringTable->EmptyString();
INIT_IMAGEASSET(Splash);
INIT_ASSET(Splash);
mSplashShaderName = StringTable->EmptyString();
@ -206,13 +206,13 @@ void PrecipitationData::packData(BitStream* stream)
{
Parent::packData(stream);
PACKDATA_SOUNDASSET(Sound);
PACKDATA_ASSET(Sound);
PACKDATA_IMAGEASSET(Drop);
PACKDATA_ASSET(Drop);
stream->writeString(mDropShaderName);
PACKDATA_IMAGEASSET(Splash);
PACKDATA_ASSET(Splash);
stream->writeString(mSplashShaderName);
stream->write(mDropsPerSide);
@ -223,13 +223,13 @@ void PrecipitationData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_SOUNDASSET(Sound);
UNPACKDATA_ASSET(Sound);
UNPACKDATA_IMAGEASSET(Drop);
UNPACKDATA_ASSET(Drop);
mDropShaderName = stream->readSTString();
UNPACKDATA_IMAGEASSET(Splash);
UNPACKDATA_ASSET(Splash);
mSplashShaderName = stream->readSTString();
stream->read(&mDropsPerSide);

View file

@ -47,15 +47,15 @@ class PrecipitationData : public GameBaseData
public:
DECLARE_SOUNDASSET(PrecipitationData, Sound);
DECLARE_SOUNDASSET_SETGET(PrecipitationData, Sound);
DECLARE_ASSET_SETGET(PrecipitationData, Sound);
DECLARE_IMAGEASSET(PrecipitationData, Drop, onDropChanged, GFXStaticTextureSRGBProfile); ///< Texture for drop particles
DECLARE_IMAGEASSET_SETGET(PrecipitationData, Drop);
DECLARE_ASSET_SETGET(PrecipitationData, Drop);
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_ASSET_SETGET(PrecipitationData, Splash);
StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops

View file

@ -70,7 +70,7 @@ SplashData::SplashData()
//soundProfile = NULL;
//soundProfileId = 0;
INIT_SOUNDASSET(Sound);
INIT_ASSET(Sound);
scale.set(1, 1, 1);
@ -98,7 +98,7 @@ SplashData::SplashData()
U32 i;
for (i = 0; i < NUM_TEX; i++)
{
INIT_IMAGEASSET_ARRAY(Texture, i);
INIT_ASSET_ARRAY(Texture, i);
}
for( i=0; i<NUM_TIME_KEYS; i++ )
@ -163,7 +163,7 @@ void SplashData::packData(BitStream* stream)
{
Parent::packData(stream);
PACKDATA_SOUNDASSET(Sound);
PACKDATA_ASSET(Sound);
mathWrite(*stream, scale);
stream->write(delayMS);
@ -208,7 +208,7 @@ void SplashData::packData(BitStream* stream)
for( i=0; i<NUM_TEX; i++ )
{
PACKDATA_IMAGEASSET_ARRAY(Texture, i);
PACKDATA_ASSET_ARRAY(Texture, i);
}
}
@ -219,7 +219,7 @@ void SplashData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_SOUNDASSET(Sound);
UNPACKDATA_ASSET(Sound);
mathRead(*stream, &scale);
stream->read(&delayMS);
@ -264,7 +264,7 @@ void SplashData::unpackData(BitStream* stream)
for( i=0; i<NUM_TEX; i++ )
{
UNPACKDATA_IMAGEASSET_ARRAY(Texture, i);
UNPACKDATA_ASSET_ARRAY(Texture, i);
}
}

View file

@ -96,7 +96,7 @@ public:
//S32 soundProfileId;
DECLARE_SOUNDASSET(SplashData, Sound);
DECLARE_SOUNDASSET_SETGET(SplashData, Sound);
DECLARE_ASSET_SETGET(SplashData, Sound);
ParticleEmitterData* emitterList[NUM_EMITTERS];
S32 emitterIDList[NUM_EMITTERS];