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

@ -137,8 +137,8 @@ VolumetricFog::VolumetricFog()
mSpeed1.set(0.5f, 0.0f);
mSpeed2.set(0.1f, 0.1f);
INIT_SHAPEASSET(Shape);
INIT_IMAGEASSET(Texture);
INIT_ASSET(Shape);
INIT_ASSET(Texture);
}
VolumetricFog::~VolumetricFog()
@ -543,7 +543,7 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
stream->write(mFogDensity);
if (stream->writeFlag(mask & FogModulationMask))
{
PACK_IMAGEASSET(con, Texture);
PACK_ASSET(con, Texture);
mTexTiles = mFabs(mTexTiles);
stream->write(mTexTiles);
stream->write(mStrength);
@ -567,7 +567,7 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
}
if (stream->writeFlag(mask & FogShapeMask))
{
PACK_SHAPEASSET(con, Shape);
PACK_ASSET(con, Shape);
mathWrite(*stream, getTransform());
mathWrite(*stream, getScale());
@ -613,7 +613,7 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream)
}
if (stream->readFlag())// Fog Modulation
{
UNPACK_IMAGEASSET(con, Texture);
UNPACK_ASSET(con, Texture);
stream->read(&mTexTiles);
mTexTiles = mFabs(mTexTiles);
stream->read(&mStrength);
@ -667,7 +667,7 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream)
}
if (stream->readFlag())//Fog shape
{
UNPACK_SHAPEASSET(con, Shape);
UNPACK_ASSET(con, Shape);
mathRead(*stream, &mat);
mathRead(*stream, &scale);

View file

@ -85,7 +85,7 @@ class VolumetricFog : public SceneObject
};
DECLARE_SHAPEASSET(VolumetricFog, Shape, onShapeChanged);
DECLARE_SHAPEASSET_NET_SETGET(VolumetricFog, Shape, FogShapeMask);
DECLARE_ASSET_NET_SETGET(VolumetricFog, Shape, FogShapeMask);
protected:
// Rendertargets;
@ -163,7 +163,7 @@ class VolumetricFog : public SceneObject
// Fog Modulation data
DECLARE_IMAGEASSET(VolumetricFog, Texture, onImageChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_NET_SETGET(VolumetricFog, Texture, FogModulationMask);
DECLARE_ASSET_NET_SETGET(VolumetricFog, Texture, FogModulationMask);
bool mIsTextured;
F32 mTexTiles;
@ -257,4 +257,4 @@ class VolumetricFog : public SceneObject
DECLARE_CALLBACK(void, onEnterFog, (SimObjectId obj));
DECLARE_CALLBACK(void, onLeaveFog, (SimObjectId obj));
};
#endif
#endif

View file

@ -215,7 +215,7 @@ U32 BasicClouds::packUpdate( NetConnection *conn, U32 mask, BitStream *stream )
{
stream->writeFlag( mLayerEnabled[i] );
PACK_IMAGEASSET_ARRAY(conn, Texture, i);
PACK_ASSET_ARRAY(conn, Texture, i);
stream->write( mTexScale[i] );
mathWrite( *stream, mTexDirection[i] );
@ -236,7 +236,7 @@ void BasicClouds::unpackUpdate( NetConnection *conn, BitStream *stream )
{
mLayerEnabled[i] = stream->readFlag();
UNPACK_IMAGEASSET_ARRAY(conn, Texture, i);
UNPACK_ASSET_ARRAY(conn, Texture, i);
stream->read( &mTexScale[i] );
mathRead( *stream, &mTexDirection[i] );

View file

@ -113,7 +113,7 @@ CloudLayer::CloudLayer()
mHeight = 4.0f;
INIT_IMAGEASSET(Texture);
INIT_ASSET(Texture);
}
IMPLEMENT_CO_NETOBJECT_V1( CloudLayer );
@ -242,7 +242,7 @@ U32 CloudLayer::packUpdate( NetConnection *conn, U32 mask, BitStream *stream )
{
U32 retMask = Parent::packUpdate( conn, mask, stream );
PACK_IMAGEASSET(conn, Texture);
PACK_ASSET(conn, Texture);
for ( U32 i = 0; i < TEX_COUNT; i++ )
{
@ -264,7 +264,7 @@ void CloudLayer::unpackUpdate( NetConnection *conn, BitStream *stream )
{
Parent::unpackUpdate( conn, stream );
UNPACK_IMAGEASSET(conn, Texture);
UNPACK_ASSET(conn, Texture);
if(mTextureAssetId != StringTable->EmptyString())
mTextureAsset = mTextureAssetId;

View file

@ -97,7 +97,7 @@ protected:
static U32 smTriangleCount;
DECLARE_IMAGEASSET(CloudLayer, Texture, onImageChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_NET_SETGET(CloudLayer, Texture, CloudLayerMask);
DECLARE_ASSET_NET_SETGET(CloudLayer, Texture, CloudLayerMask);
GFXShaderRef mShader;
@ -136,4 +136,4 @@ protected:
};
#endif // _CLOUDLAYER_H_
#endif // _CLOUDLAYER_H_

View file

@ -287,7 +287,7 @@ DecalRoad::DecalRoad()
mTypeMask |= StaticObjectType | StaticShapeObjectType;
mNetFlags.set(Ghostable);
INIT_MATERIALASSET(Material);
INIT_ASSET(Material);
mMaterialInst = nullptr;
}
@ -491,7 +491,7 @@ U32 DecalRoad::packUpdate(NetConnection * con, U32 mask, BitStream * stream)
if ( stream->writeFlag( mask & DecalRoadMask ) )
{
// Write Texture Name.
PACK_MATERIALASSET(con, Material);
PACK_ASSET(con, Material);
stream->write( mBreakAngle );
@ -580,7 +580,7 @@ void DecalRoad::unpackUpdate( NetConnection *con, BitStream *stream )
// DecalRoadMask
if ( stream->readFlag() )
{
UNPACK_MATERIALASSET(con, Material);
UNPACK_ASSET(con, Material);
if (isProperlyAdded())
_initMaterial();

View file

@ -243,7 +243,7 @@ protected:
BaseMatInstance* mMaterialInst;
DECLARE_MATERIALASSET(DecalRoad, Material);
DECLARE_MATERIALASSET_NET_SETGET(DecalRoad, Material, DecalRoadMask);
DECLARE_ASSET_NET_SETGET(DecalRoad, Material, DecalRoadMask);
U32 mRenderPriority;

View file

@ -97,9 +97,9 @@ GuiMeshRoadEditorCtrl::GuiMeshRoadEditorCtrl()
mHoverNodeColor( 255,255,255,255 ),
mHasCopied( false )
{
INIT_MATERIALASSET(TopMaterial);
INIT_MATERIALASSET(BottomMaterial);
INIT_MATERIALASSET(SideMaterial);
INIT_ASSET(TopMaterial);
INIT_ASSET(BottomMaterial);
INIT_ASSET(SideMaterial);
mTopMaterialAssetId = Con::getVariable("$MeshRoadEditor::defaultTopMaterialAsset");
mBottomMaterialAssetId = Con::getVariable("$MeshRoadEditor::defaultBottomMaterialAsset");

View file

@ -160,13 +160,13 @@ class GuiMeshRoadEditorCtrl : public EditTSCtrl
public:
DECLARE_MATERIALASSET(GuiMeshRoadEditorCtrl, TopMaterial);
DECLARE_MATERIALASSET_SETGET(GuiMeshRoadEditorCtrl, TopMaterial);
DECLARE_ASSET_SETGET(GuiMeshRoadEditorCtrl, TopMaterial);
DECLARE_MATERIALASSET(GuiMeshRoadEditorCtrl, BottomMaterial);
DECLARE_MATERIALASSET_SETGET(GuiMeshRoadEditorCtrl, BottomMaterial);
DECLARE_ASSET_SETGET(GuiMeshRoadEditorCtrl, BottomMaterial);
DECLARE_MATERIALASSET(GuiMeshRoadEditorCtrl, SideMaterial);
DECLARE_MATERIALASSET_SETGET(GuiMeshRoadEditorCtrl, SideMaterial);
DECLARE_ASSET_SETGET(GuiMeshRoadEditorCtrl, SideMaterial);
};
class GuiMeshRoadEditorUndoAction : public UndoAction

View file

@ -104,7 +104,7 @@ class GuiRoadEditorCtrl : public EditTSCtrl
public:
DECLARE_MATERIALASSET(GuiRoadEditorCtrl, Material);
DECLARE_MATERIALASSET_SETGET(GuiRoadEditorCtrl, Material);
DECLARE_ASSET_SETGET(GuiRoadEditorCtrl, Material);
protected:

View file

@ -920,9 +920,9 @@ MeshRoad::MeshRoad()
mTriangleCount[i] = 0;
}
INIT_MATERIALASSET(TopMaterial);
INIT_MATERIALASSET(BottomMaterial);
INIT_MATERIALASSET(SideMaterial);
INIT_ASSET(TopMaterial);
INIT_ASSET(BottomMaterial);
INIT_ASSET(SideMaterial);
mSideProfile.mRoad = this;
}
@ -1416,9 +1416,9 @@ U32 MeshRoad::packUpdate(NetConnection * con, U32 mask, BitStream * stream)
stream->writeAffineTransform( mObjToWorld );
// Write Materials
PACK_MATERIALASSET(con, TopMaterial);
PACK_MATERIALASSET(con, BottomMaterial);
PACK_MATERIALASSET(con, SideMaterial);
PACK_ASSET(con, TopMaterial);
PACK_ASSET(con, BottomMaterial);
PACK_ASSET(con, SideMaterial);
stream->write( mTextureLength );
stream->write( mBreakAngle );
@ -1515,9 +1515,9 @@ void MeshRoad::unpackUpdate(NetConnection * con, BitStream * stream)
stream->readAffineTransform(&ObjectMatrix);
Parent::setTransform(ObjectMatrix);
UNPACK_MATERIALASSET(con, TopMaterial);
UNPACK_MATERIALASSET(con, BottomMaterial);
UNPACK_MATERIALASSET(con, SideMaterial);
UNPACK_ASSET(con, TopMaterial);
UNPACK_ASSET(con, BottomMaterial);
UNPACK_ASSET(con, SideMaterial);
if ( isProperlyAdded() )
_initMaterial();

View file

@ -622,13 +622,13 @@ protected:
GFXPrimitiveBufferHandle mPB[SurfaceCount];
DECLARE_MATERIALASSET(MeshRoad, TopMaterial);
DECLARE_MATERIALASSET_NET_SETGET(MeshRoad, TopMaterial, MeshRoadMask);
DECLARE_ASSET_NET_SETGET(MeshRoad, TopMaterial, MeshRoadMask);
DECLARE_MATERIALASSET(MeshRoad, BottomMaterial);
DECLARE_MATERIALASSET_NET_SETGET(MeshRoad, BottomMaterial, MeshRoadMask);
DECLARE_ASSET_NET_SETGET(MeshRoad, BottomMaterial, MeshRoadMask);
DECLARE_MATERIALASSET(MeshRoad, SideMaterial);
DECLARE_MATERIALASSET_NET_SETGET(MeshRoad, SideMaterial, MeshRoadMask);
DECLARE_ASSET_NET_SETGET(MeshRoad, SideMaterial, MeshRoadMask);
//String mMaterialName[SurfaceCount];
SimObjectPtr<Material> mMaterial[SurfaceCount];

View file

@ -168,7 +168,7 @@ ScatterSky::ScatterSky()
mNightCubemapName = StringTable->EmptyString();
mSunSize = 1.0f;
INIT_MATERIALASSET(MoonMat);
INIT_ASSET(MoonMat);
mMoonMatInst = NULL;
@ -503,7 +503,7 @@ U32 ScatterSky::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
stream->writeFlag( mMoonEnabled );
PACK_MATERIALASSET(con, MoonMat);
PACK_ASSET(con, MoonMat);
stream->write( mMoonScale );
stream->write( mMoonTint );
@ -617,7 +617,7 @@ void ScatterSky::unpackUpdate(NetConnection *con, BitStream *stream)
mMoonEnabled = stream->readFlag();
UNPACK_MATERIALASSET(con, MoonMat);
UNPACK_ASSET(con, MoonMat);
stream->read( &mMoonScale );
stream->read( &mMoonTint );

View file

@ -212,7 +212,7 @@ protected:
bool mMoonEnabled;
DECLARE_MATERIALASSET(ScatterSky, MoonMat);
DECLARE_MATERIALASSET_NET_SETGET(ScatterSky, MoonMat, UpdateMask);
DECLARE_ASSET_NET_SETGET(ScatterSky, MoonMat, UpdateMask);
BaseMatInstance *mMoonMatInst;
F32 mMoonScale;

View file

@ -56,7 +56,7 @@ SkyBox::SkyBox()
mTypeMask |= EnvironmentObjectType | StaticObjectType;
mNetFlags.set(Ghostable | ScopeAlways);
INIT_MATERIALASSET(Material);
INIT_ASSET(Material);
mMatInstance = NULL;
mIsVBDirty = false;
@ -139,7 +139,7 @@ U32 SkyBox::packUpdate( NetConnection *conn, U32 mask, BitStream *stream )
{
U32 retMask = Parent::packUpdate( conn, mask, stream );
PACK_MATERIALASSET(conn, Material);
PACK_ASSET(conn, Material);
stream->writeFlag( mDrawBottom );
stream->write( mFogBandHeight );
@ -152,7 +152,7 @@ void SkyBox::unpackUpdate( NetConnection *conn, BitStream *stream )
Parent::unpackUpdate( conn, stream );
StringTableEntry oldMatName = getMaterial();
UNPACK_MATERIALASSET(conn, Material);
UNPACK_ASSET(conn, Material);
if (oldMatName != getMaterial())
{
_updateMaterial();

View file

@ -102,7 +102,7 @@ protected:
// Material
DECLARE_MATERIALASSET(SkyBox, Material);
DECLARE_MATERIALASSET_NET_SETGET(SkyBox, Material, -1);
DECLARE_ASSET_NET_SETGET(SkyBox, Material, -1);
BaseMatInstance *mMatInstance;
SkyMatParams mMatParamHandle;

View file

@ -90,7 +90,7 @@ Sun::Sun()
mCoronaUseLightColor = true;
mCoronaMatInst = NULL;
INIT_MATERIALASSET(CoronaMaterial);
INIT_ASSET(CoronaMaterial);
mMatrixSet = reinterpret_cast<MatrixSet *>(dMalloc_aligned(sizeof(MatrixSet), 16));
constructInPlace(mMatrixSet);
@ -240,7 +240,7 @@ U32 Sun::packUpdate(NetConnection *conn, U32 mask, BitStream *stream )
stream->writeFlag( mCoronaEnabled );
PACK_MATERIALASSET(conn, CoronaMaterial);
PACK_ASSET(conn, CoronaMaterial);
stream->write( mCoronaScale );
stream->write( mCoronaTint );
@ -286,7 +286,7 @@ void Sun::unpackUpdate( NetConnection *conn, BitStream *stream )
mCoronaEnabled = stream->readFlag();
UNPACK_MATERIALASSET(conn, CoronaMaterial);
UNPACK_ASSET(conn, CoronaMaterial);
stream->read( &mCoronaScale );
stream->read( &mCoronaTint );

View file

@ -79,7 +79,7 @@ protected:
bool mCoronaEnabled;
DECLARE_MATERIALASSET(Sun, CoronaMaterial);
DECLARE_MATERIALASSET_NET_SETGET(Sun, CoronaMaterial, UpdateMask);
DECLARE_ASSET_NET_SETGET(Sun, CoronaMaterial, UpdateMask);
BaseMatInstance *mCoronaMatInst;
MatrixSet *mMatrixSet;

View file

@ -260,9 +260,9 @@ WaterObject::WaterObject()
mMatrixSet = reinterpret_cast<MatrixSet *>(dMalloc_aligned(sizeof(MatrixSet), 16));
constructInPlace(mMatrixSet);
INIT_IMAGEASSET(RippleTex);
INIT_IMAGEASSET(FoamTex);
INIT_IMAGEASSET(DepthGradientTex);
INIT_ASSET(RippleTex);
INIT_ASSET(FoamTex);
INIT_ASSET(DepthGradientTex);
mCubemapName = StringTable->EmptyString();
}
@ -546,9 +546,9 @@ U32 WaterObject::packUpdate( NetConnection * conn, U32 mask, BitStream *stream )
if ( stream->writeFlag( mask & TextureMask ) )
{
PACK_IMAGEASSET(conn, RippleTex);
PACK_IMAGEASSET(conn, DepthGradientTex);
PACK_IMAGEASSET(conn, FoamTex);
PACK_ASSET(conn, RippleTex);
PACK_ASSET(conn, DepthGradientTex);
PACK_ASSET(conn, FoamTex);
stream->writeString( mCubemapName );
}
@ -668,9 +668,9 @@ void WaterObject::unpackUpdate( NetConnection * conn, BitStream *stream )
// TextureMask
if ( stream->readFlag() )
{
UNPACK_IMAGEASSET(conn, RippleTex);
UNPACK_IMAGEASSET(conn, DepthGradientTex);
UNPACK_IMAGEASSET(conn, FoamTex);
UNPACK_ASSET(conn, RippleTex);
UNPACK_ASSET(conn, DepthGradientTex);
UNPACK_ASSET(conn, FoamTex);
mCubemapName = stream->readSTString();

View file

@ -273,11 +273,11 @@ protected:
// Other textures
DECLARE_IMAGEASSET(WaterObject, RippleTex, onRippleTexChanged, GFXStaticTextureProfile);
DECLARE_IMAGEASSET_NET_SETGET(WaterObject, RippleTex, TextureMask);
DECLARE_ASSET_NET_SETGET(WaterObject, RippleTex, TextureMask);
DECLARE_IMAGEASSET(WaterObject, FoamTex, onFoamTexChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_NET_SETGET(WaterObject, FoamTex, TextureMask);
DECLARE_ASSET_NET_SETGET(WaterObject, FoamTex, TextureMask);
DECLARE_IMAGEASSET(WaterObject, DepthGradientTex, onDepthGradientTexChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_NET_SETGET(WaterObject, DepthGradientTex, TextureMask);
DECLARE_ASSET_NET_SETGET(WaterObject, DepthGradientTex, TextureMask);
StringTableEntry mCubemapName;