From 73ad92b7578ab81b8ec1b2246a3c2e00c5627261 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sun, 30 Mar 2025 11:22:42 +0100 Subject: [PATCH] review notes from Az Should render fallback for namedTarget if namedTarget fails Add safety around namedtarget getTexture to stop assert Missing assets should revert to fallback image and print a warning to console Remove REFACTOR tag from all macros. --- Engine/source/T3D/accumulationVolume.cpp | 2 +- Engine/source/T3D/accumulationVolume.h | 2 +- Engine/source/T3D/assets/ImageAsset.cpp | 18 ++++-- Engine/source/T3D/assets/ImageAsset.h | 34 ++++++++--- Engine/source/T3D/fx/particle.cpp | 4 +- Engine/source/T3D/fx/particle.h | 4 +- Engine/source/T3D/fx/precipitation.cpp | 4 +- Engine/source/T3D/fx/precipitation.h | 4 +- Engine/source/T3D/fx/splash.cpp | 2 +- Engine/source/T3D/fx/splash.h | 2 +- Engine/source/T3D/gameMode.cpp | 2 +- Engine/source/T3D/gameMode.h | 2 +- Engine/source/T3D/levelInfo.cpp | 2 +- Engine/source/T3D/levelInfo.h | 2 +- Engine/source/T3D/lightFlareData.cpp | 2 +- Engine/source/T3D/lightFlareData.h | 2 +- Engine/source/afx/ce/afxBillboard.cpp | 2 +- Engine/source/afx/ce/afxBillboard.h | 2 +- Engine/source/afx/ce/afxZodiac.cpp | 2 +- Engine/source/afx/ce/afxZodiac.h | 2 +- Engine/source/afx/ce/afxZodiacPlane.cpp | 2 +- Engine/source/afx/ce/afxZodiacPlane.h | 2 +- Engine/source/environment/VolumetricFog.cpp | 2 +- Engine/source/environment/VolumetricFog.h | 2 +- Engine/source/environment/basicClouds.cpp | 2 +- Engine/source/environment/basicClouds.h | 2 +- Engine/source/environment/cloudLayer.cpp | 2 +- Engine/source/environment/cloudLayer.h | 2 +- Engine/source/environment/waterObject.cpp | 6 +- Engine/source/environment/waterObject.h | 6 +- Engine/source/gfx/sim/cubemapData.cpp | 4 +- Engine/source/gfx/sim/cubemapData.h | 4 +- .../gui/buttons/guiBitmapButtonCtrl.cpp | 2 +- .../source/gui/buttons/guiIconButtonCtrl.cpp | 2 +- Engine/source/gui/buttons/guiIconButtonCtrl.h | 2 +- .../gui/buttons/guiToolboxButtonCtrl.cpp | 6 +- .../source/gui/buttons/guiToolboxButtonCtrl.h | 6 +- Engine/source/gui/controls/guiBitmapCtrl.cpp | 2 +- Engine/source/gui/controls/guiBitmapCtrl.h | 2 +- .../gui/controls/guiGameSettingsCtrl.cpp | 6 +- .../source/gui/controls/guiGameSettingsCtrl.h | 6 +- Engine/source/gui/controls/guiPopUpCtrl.h | 2 +- Engine/source/gui/controls/guiPopUpCtrlEx.h | 2 +- Engine/source/gui/core/guiTypes.cpp | 2 +- Engine/source/gui/core/guiTypes.h | 4 +- .../source/gui/game/guiChunkedBitmapCtrl.cpp | 2 +- Engine/source/gui/game/guiChunkedBitmapCtrl.h | 2 +- .../source/gui/game/guiProgressBitmapCtrl.cpp | 2 +- .../source/gui/game/guiProgressBitmapCtrl.h | 2 +- .../source/gui/worldEditor/guiMissionArea.cpp | 2 +- .../source/gui/worldEditor/guiMissionArea.h | 2 +- Engine/source/gui/worldEditor/worldEditor.cpp | 6 +- Engine/source/gui/worldEditor/worldEditor.h | 6 +- .../source/materials/materialDefinition.cpp | 48 ++++++++-------- Engine/source/materials/materialDefinition.h | 24 ++++---- .../materials/processedShaderMaterial.cpp | 57 +++++++++---------- Engine/source/postFx/postEffect.cpp | 2 +- Engine/source/postFx/postEffect.h | 2 +- Engine/source/terrain/terrMaterial.cpp | 10 ++-- Engine/source/terrain/terrMaterial.h | 10 ++-- 60 files changed, 189 insertions(+), 164 deletions(-) diff --git a/Engine/source/T3D/accumulationVolume.cpp b/Engine/source/T3D/accumulationVolume.cpp index dfada6d06..682125ef5 100644 --- a/Engine/source/T3D/accumulationVolume.cpp +++ b/Engine/source/T3D/accumulationVolume.cpp @@ -93,7 +93,7 @@ AccumulationVolume::~AccumulationVolume() void AccumulationVolume::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, AccumulationVolume, "Accumulation texture.") + INITPERSISTFIELD_IMAGEASSET(Texture, AccumulationVolume, "Accumulation texture.") Parent::initPersistFields(); } diff --git a/Engine/source/T3D/accumulationVolume.h b/Engine/source/T3D/accumulationVolume.h index 53c24843c..0c5fe4fe1 100644 --- a/Engine/source/T3D/accumulationVolume.h +++ b/Engine/source/T3D/accumulationVolume.h @@ -61,7 +61,7 @@ class AccumulationVolume : public ScenePolyhedralSpace // SceneSpace. void _renderObject( ObjectRenderInst* ri, SceneRenderState* state, BaseMatInstance* overrideMat ) override; - DECLARE_IMAGEASSET_NET_REFACTOR(AccumulationVolume, Texture, GFXStaticTextureSRGBProfile, -1) + DECLARE_IMAGEASSET_NET(AccumulationVolume, Texture, GFXStaticTextureSRGBProfile, -1) public: diff --git a/Engine/source/T3D/assets/ImageAsset.cpp b/Engine/source/T3D/assets/ImageAsset.cpp index 04ff2e11c..e26533524 100644 --- a/Engine/source/T3D/assets/ImageAsset.cpp +++ b/Engine/source/T3D/assets/ImageAsset.cpp @@ -484,16 +484,22 @@ GFXTexHandle ImageAsset::getTexture(GFXTextureProfile* requestedProfile) if (isNamedTarget()) { - GFXTexHandle tex = getNamedTarget()->getTexture(); - if(tex.isNull()) + GFXTexHandle tex; + AssetPtr fallbackAsset; + ImageAsset::getAssetById(smNamedTargetAssetFallback, &fallbackAsset); + if (getNamedTarget().isValid()) { - AssetPtr fallbackAsset; - ImageAsset::getAssetById(smNamedTargetAssetFallback, &fallbackAsset); - return fallbackAsset->getTexture(); + tex = getNamedTarget()->getTexture(); + if (tex.isNull()) + { + return fallbackAsset->getTexture(); + } + + return tex; } else { - return tex; + return fallbackAsset->getTexture(); } } diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h index 9844b92b2..6dc97f933 100644 --- a/Engine/source/T3D/assets/ImageAsset.h +++ b/Engine/source/T3D/assets/ImageAsset.h @@ -241,7 +241,7 @@ DefineEnumType(ImageAssetType); #pragma region Refactor Asset Macros -#define DECLARE_IMAGEASSET_REFACTOR(className, name, profile) \ +#define DECLARE_IMAGEASSET(className, name, profile) \ private: \ AssetPtr m##name##Asset; \ public: \ @@ -268,6 +268,11 @@ public: imageAssetId = AssetDatabase.addPrivateAsset(privateImage); \ } \ } \ + else \ + { \ + Con::warnf("%s::%s: Could not find asset for: %s using fallback", #className, #name, _in); \ + imageAssetId = ImageAsset::smNoImageAssetFallback; \ + } \ m##name##Asset = imageAssetId; \ } \ else \ @@ -282,7 +287,7 @@ public: static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast(obj)->_set##name(_getStringTable()->insert(data)); return false;} -#define DECLARE_IMAGEASSET_NET_REFACTOR(className, name, profile, mask) \ +#define DECLARE_IMAGEASSET_NET(className, name, profile, mask) \ private: \ AssetPtr m##name##Asset; \ public: \ @@ -308,6 +313,11 @@ public: imageAssetId = AssetDatabase.addPrivateAsset(privateImage); \ } \ } \ + else \ + { \ + Con::warnf("%s::%s: Could not find asset for: %s using fallback", #className, #name, _in); \ + imageAssetId = ImageAsset::smNoImageAssetFallback; \ + } \ m##name##Asset = imageAssetId; \ } \ else \ @@ -323,11 +333,11 @@ public: static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast(obj)->_set##name(_getStringTable()->insert(data)); return false;} -#define INITPERSISTFIELD_IMAGEASSET_REFACTOR(name, consoleClass, docs) \ +#define INITPERSISTFIELD_IMAGEASSET(name, consoleClass, docs) \ addProtectedField(assetText(name, Asset), TypeImageAssetPtr, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, asset docs.)); -#define DECLARE_IMAGEASSET_ARRAY_REFACTOR(className, name, profile, max) \ +#define DECLARE_IMAGEASSET_ARRAY(className, name, profile, max) \ private: \ AssetPtr m##name##Asset[max]; \ public: \ @@ -353,6 +363,11 @@ public: imageAssetId = AssetDatabase.addPrivateAsset(privateImage); \ } \ } \ + else \ + { \ + Con::warnf("%s::%s: Could not find asset for: %s using fallback", #className, #name, _in); \ + imageAssetId = ImageAsset::smNoImageAssetFallback; \ + } \ m##name##Asset[index] = imageAssetId; \ } \ else \ @@ -368,7 +383,7 @@ public: static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;} -#define DECLARE_IMAGEASSET_ARRAY_NET_REFACTOR(className, name, profile, max, mask) \ +#define DECLARE_IMAGEASSET_ARRAY_NET(className, name, profile, max, mask) \ private: \ AssetPtr m##name##Asset[max]; \ public: \ @@ -394,6 +409,11 @@ public: imageAssetId = AssetDatabase.addPrivateAsset(privateImage); \ } \ } \ + else \ + { \ + Con::warnf("%s::%s: Could not find asset for: %s using fallback", #className, #name, _in); \ + imageAssetId = ImageAsset::smNoImageAssetFallback; \ + } \ m##name##Asset[index] = imageAssetId; \ } \ else \ @@ -410,10 +430,10 @@ public: static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;} -#define INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(name, arraySize, consoleClass, docs) \ +#define INITPERSISTFIELD_IMAGEASSET_ARRAY(name, arraySize, consoleClass, docs) \ addProtectedField(assetText(name, Asset), TypeImageAssetPtr, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.)); -#define DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(className,name, max)\ +#define DEF_IMAGEASSET_ARRAY_BINDS(className,name, max)\ DefineEngineMethod(className, get##name, const char*, (S32 index), , "get name")\ {\ return object->get##name##Asset(index).notNull() ? object->get##name##Asset(index)->getImageFile() : ""; \ diff --git a/Engine/source/T3D/fx/particle.cpp b/Engine/source/T3D/fx/particle.cpp index 1f6c3685e..b2457dfea 100644 --- a/Engine/source/T3D/fx/particle.cpp +++ b/Engine/source/T3D/fx/particle.cpp @@ -148,7 +148,7 @@ void ParticleData::initPersistFields() { docsURL; addGroup("Basic"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, ParticleData, "Texture to use for this particle."); + INITPERSISTFIELD_IMAGEASSET(Texture, ParticleData, "Texture to use for this particle."); addField("useInvAlpha", TYPEID< bool >(), Offset(useInvAlpha, ParticleData), "@brief Controls how particles blend with the scene.\n\n" "If true, particles blend like ParticleBlendStyle NORMAL, if false, " @@ -233,7 +233,7 @@ void ParticleData::initPersistFields() endGroup("Over Time"); addGroup("AFX"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(TextureExt, ParticleData, ""); + INITPERSISTFIELD_IMAGEASSET(TextureExt, ParticleData, ""); addField("constrainPos", TypeBool, Offset(constrain_pos, ParticleData)); addFieldV("angle", TypeRangedF32, Offset(start_angle, ParticleData), &CommonValidators::DegreeRange); addFieldV("angleVariance", TypeRangedF32, Offset(angle_variance, ParticleData), &CommonValidators::DegreeRange); diff --git a/Engine/source/T3D/fx/particle.h b/Engine/source/T3D/fx/particle.h index 033a864a4..e1ead31af 100644 --- a/Engine/source/T3D/fx/particle.h +++ b/Engine/source/T3D/fx/particle.h @@ -86,7 +86,7 @@ class ParticleData : public SimDataBlock StringTableEntry animTexFramesString; Vector animTexFrames; - DECLARE_IMAGEASSET_REFACTOR(ParticleData, Texture, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(ParticleData, Texture, GFXStaticTextureSRGBProfile) static bool protectedSetSizes(void* object, const char* index, const char* data); static bool protectedSetTimes(void* object, const char* index, const char* data); @@ -114,7 +114,7 @@ public: F32 spinBias; bool randomizeSpinDir; public: - DECLARE_IMAGEASSET_REFACTOR(ParticleData, TextureExt,GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(ParticleData, TextureExt,GFXStaticTextureSRGBProfile) bool constrain_pos; F32 start_angle; diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 3d00ed805..9953b2228 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -142,7 +142,7 @@ void PrecipitationData::initPersistFields() docsURL; INITPERSISTFIELD_SOUNDASSET(Sound, PrecipitationData, "Looping SFXProfile effect to play while Precipitation is active."); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Drop, PrecipitationData, "@brief Texture for drop particles.\n\n" + INITPERSISTFIELD_IMAGEASSET(Drop, PrecipitationData, "@brief Texture for drop particles.\n\n" "The drop texture can contain several different drop sub-textures " "arranged in a grid. There must be the same number of rows as columns. A " "random frame will be chosen for each drop."); @@ -150,7 +150,7 @@ void PrecipitationData::initPersistFields() addField( "dropShader", TypeString, Offset(mDropShaderName, PrecipitationData), "The name of the shader used for raindrops." ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Splash, PrecipitationData, "@brief Texture for splash particles.\n\n" + INITPERSISTFIELD_IMAGEASSET(Splash, PrecipitationData, "@brief Texture for splash particles.\n\n" "The splash texture can contain several different splash sub-textures " "arranged in a grid. There must be the same number of rows as columns. A " "random frame will be chosen for each splash."); diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index 676f7df31..96fe3844e 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -49,11 +49,11 @@ class PrecipitationData : public GameBaseData DECLARE_SOUNDASSET(PrecipitationData, Sound); DECLARE_ASSET_SETGET(PrecipitationData, Sound); - DECLARE_IMAGEASSET_REFACTOR(PrecipitationData, Drop, GFXStaticTextureSRGBProfile) ///< Texture for drop particles + DECLARE_IMAGEASSET(PrecipitationData, Drop, GFXStaticTextureSRGBProfile) ///< Texture for drop particles StringTableEntry mDropShaderName; ///< The name of the shader used for raindrops - DECLARE_IMAGEASSET_REFACTOR(PrecipitationData, Splash, GFXStaticTextureSRGBProfile) ///< Texture for splash particles + DECLARE_IMAGEASSET(PrecipitationData, Splash, GFXStaticTextureSRGBProfile) ///< Texture for splash particles StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index 5139f479a..3b3639c38 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -128,7 +128,7 @@ void SplashData::initPersistFields() addFieldV("times", TypeRangedF32, Offset(times, SplashData), &CommonValidators::NormalizedFloat, NUM_TIME_KEYS, "Times to transition through the splash effect. Up to 4 allowed. Values are 0.0 - 1.0, and corrispond to the life of the particle where 0 is first created and 1 is end of lifespace.\n" ); addField("colors", TypeColorF, Offset(colors, SplashData), NUM_TIME_KEYS, "Color values to set the splash effect, rgba. Up to 4 allowed. Will transition through colors based on values set in the times value. Example: colors[0] = \"0.6 1.0 1.0 0.5\".\n" ); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(Texture, NUM_TEX, SplashData, "Image to use as the texture for the splash effect.\n"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(Texture, NUM_TEX, SplashData, "Image to use as the texture for the splash effect.\n"); addFieldV("texWrap", TypeRangedF32, Offset(texWrap, SplashData), &CommonValidators::NormalizedFloat, "Amount to wrap the texture around the splash ring, 0.0f - 1.0f.\n"); addFieldV("texFactor", TypeRangedF32, Offset(texFactor, SplashData), &CommonValidators::NormalizedFloat, "Factor in which to apply the texture to the splash ring, 0.0f - 1.0f.\n"); diff --git a/Engine/source/T3D/fx/splash.h b/Engine/source/T3D/fx/splash.h index 84ce47202..8ac072b9b 100644 --- a/Engine/source/T3D/fx/splash.h +++ b/Engine/source/T3D/fx/splash.h @@ -122,7 +122,7 @@ public: F32 times[ NUM_TIME_KEYS ]; LinearColorF colors[ NUM_TIME_KEYS ]; - DECLARE_IMAGEASSET_ARRAY_REFACTOR(SplashData, Texture, GFXStaticTextureSRGBProfile, NUM_TEX) + DECLARE_IMAGEASSET_ARRAY(SplashData, Texture, GFXStaticTextureSRGBProfile, NUM_TEX) ExplosionData* explosion; S32 explosionId; diff --git a/Engine/source/T3D/gameMode.cpp b/Engine/source/T3D/gameMode.cpp index db550b4f2..32776bc4d 100644 --- a/Engine/source/T3D/gameMode.cpp +++ b/Engine/source/T3D/gameMode.cpp @@ -62,7 +62,7 @@ void GameMode::initPersistFields() addField("gameModeName", TypeString, Offset(mGameModeName, GameMode), "Human-readable name of the gamemode"); addField("description", TypeString, Offset(mGameModeDesc, GameMode), "Description of the gamemode"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(PreviewImage, GameMode, "Preview Image"); + INITPERSISTFIELD_IMAGEASSET(PreviewImage, GameMode, "Preview Image"); addField("active", TypeBool, Offset(mIsActive, GameMode), "Is the gamemode active"); addField("alwaysActive", TypeBool, Offset(mIsAlwaysActive, GameMode), "Is the gamemode always active"); diff --git a/Engine/source/T3D/gameMode.h b/Engine/source/T3D/gameMode.h index 1efa9602c..465a614f2 100644 --- a/Engine/source/T3D/gameMode.h +++ b/Engine/source/T3D/gameMode.h @@ -21,7 +21,7 @@ private: StringTableEntry mGameModeName; StringTableEntry mGameModeDesc; - DECLARE_IMAGEASSET_REFACTOR(GameMode, PreviewImage, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(GameMode, PreviewImage, GFXStaticTextureSRGBProfile) bool mIsActive; bool mIsAlwaysActive; diff --git a/Engine/source/T3D/levelInfo.cpp b/Engine/source/T3D/levelInfo.cpp index 485223468..82d3b55c5 100644 --- a/Engine/source/T3D/levelInfo.cpp +++ b/Engine/source/T3D/levelInfo.cpp @@ -169,7 +169,7 @@ void LevelInfo::initPersistFields() //addField( "advancedLightmapSupport", TypeBool, Offset( mAdvancedLightmapSupport, LevelInfo ), // "Enable expanded support for mixing static and dynamic lighting (more costly)" ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(AccuTexture, LevelInfo, "Accumulation texture."); + INITPERSISTFIELD_IMAGEASSET(AccuTexture, LevelInfo, "Accumulation texture."); endGroup( "Lighting" ); diff --git a/Engine/source/T3D/levelInfo.h b/Engine/source/T3D/levelInfo.h index d6a28155e..593910dd4 100644 --- a/Engine/source/T3D/levelInfo.h +++ b/Engine/source/T3D/levelInfo.h @@ -106,7 +106,7 @@ class LevelInfo : public NetObject void _onLMActivate(const char *lm, bool enable); protected: - DECLARE_IMAGEASSET_REFACTOR(LevelInfo, AccuTexture, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(LevelInfo, AccuTexture, GFXStaticTextureSRGBProfile) public: diff --git a/Engine/source/T3D/lightFlareData.cpp b/Engine/source/T3D/lightFlareData.cpp index 59fc369d7..0ee3821d6 100644 --- a/Engine/source/T3D/lightFlareData.cpp +++ b/Engine/source/T3D/lightFlareData.cpp @@ -159,7 +159,7 @@ void LightFlareData::initPersistFields() addField( "flareEnabled", TypeBool, Offset( mFlareEnabled, LightFlareData ), "Allows the user to disable this flare globally for any lights referencing it." ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(FlareTexture, LightFlareData, "The texture / sprite sheet for this flare."); + INITPERSISTFIELD_IMAGEASSET(FlareTexture, LightFlareData, "The texture / sprite sheet for this flare."); addArray( "Elements", MAX_ELEMENTS ); diff --git a/Engine/source/T3D/lightFlareData.h b/Engine/source/T3D/lightFlareData.h index 952d8f56a..e31c8c752 100644 --- a/Engine/source/T3D/lightFlareData.h +++ b/Engine/source/T3D/lightFlareData.h @@ -118,7 +118,7 @@ protected: F32 mScale; bool mFlareEnabled; - DECLARE_IMAGEASSET_REFACTOR(LightFlareData, FlareTexture, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(LightFlareData, FlareTexture, GFXStaticTextureSRGBProfile) F32 mOcclusionRadius; bool mRenderReflectPass; diff --git a/Engine/source/afx/ce/afxBillboard.cpp b/Engine/source/afx/ce/afxBillboard.cpp index 9e07ab51d..9134c0354 100644 --- a/Engine/source/afx/ce/afxBillboard.cpp +++ b/Engine/source/afx/ce/afxBillboard.cpp @@ -95,7 +95,7 @@ void afxBillboardData::initPersistFields() "The color assigned to the quadrangle geometry. The way it combines with the given " "texture varies according to the setting of the textureFunction field."); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, afxBillboardData, "An image to use as the billboard's texture."); + INITPERSISTFIELD_IMAGEASSET(Texture, afxBillboardData, "An image to use as the billboard's texture."); addField("dimensions", TypePoint2F, myOffset(dimensions), "A value-pair that specifies the horizontal and vertical dimensions of the billboard " diff --git a/Engine/source/afx/ce/afxBillboard.h b/Engine/source/afx/ce/afxBillboard.h index 1884e6800..34e278206 100644 --- a/Engine/source/afx/ce/afxBillboard.h +++ b/Engine/source/afx/ce/afxBillboard.h @@ -47,7 +47,7 @@ public: }; public: - DECLARE_IMAGEASSET_REFACTOR(afxBillboardData, Texture, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(afxBillboardData, Texture, GFXStaticTextureSRGBProfile) LinearColorF color; diff --git a/Engine/source/afx/ce/afxZodiac.cpp b/Engine/source/afx/ce/afxZodiac.cpp index 88d9d9fec..2df200230 100644 --- a/Engine/source/afx/ce/afxZodiac.cpp +++ b/Engine/source/afx/ce/afxZodiac.cpp @@ -155,7 +155,7 @@ EndImplementEnumType; void afxZodiacData::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, afxZodiacData, "An image to use as the zodiac's texture."); + INITPERSISTFIELD_IMAGEASSET(Texture, afxZodiacData, "An image to use as the zodiac's texture."); addField("radius", TypeF32, Offset(radius_xy, afxZodiacData), "The zodiac's radius in scene units."); addField("verticalRange", TypePoint2F, Offset(vert_range, afxZodiacData), diff --git a/Engine/source/afx/ce/afxZodiac.h b/Engine/source/afx/ce/afxZodiac.h index 9163f2d4b..501dfc034 100644 --- a/Engine/source/afx/ce/afxZodiac.h +++ b/Engine/source/afx/ce/afxZodiac.h @@ -57,7 +57,7 @@ public: static void convertGradientRangeFromDegrees(Point2F& gradrange, const Point2F& gradrange_deg); public: - DECLARE_IMAGEASSET_REFACTOR(afxZodiacData, Texture, AFX_GFXZodiacTextureProfile) + DECLARE_IMAGEASSET(afxZodiacData, Texture, AFX_GFXZodiacTextureProfile) F32 radius_xy; Point2F vert_range; diff --git a/Engine/source/afx/ce/afxZodiacPlane.cpp b/Engine/source/afx/ce/afxZodiacPlane.cpp index fe59d9c0b..c57eeda05 100644 --- a/Engine/source/afx/ce/afxZodiacPlane.cpp +++ b/Engine/source/afx/ce/afxZodiacPlane.cpp @@ -110,7 +110,7 @@ EndImplementEnumType; void afxZodiacPlaneData::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, afxZodiacPlaneData, "An image to use as the zodiac's texture."); + INITPERSISTFIELD_IMAGEASSET(Texture, afxZodiacPlaneData, "An image to use as the zodiac's texture."); addFieldV("radius", TypeRangedF32, myOffset(radius_xy), &CommonValidators::PositiveFloat, "The zodiac's radius in scene units."); diff --git a/Engine/source/afx/ce/afxZodiacPlane.h b/Engine/source/afx/ce/afxZodiacPlane.h index 0ce187d89..9e7cef512 100644 --- a/Engine/source/afx/ce/afxZodiacPlane.h +++ b/Engine/source/afx/ce/afxZodiacPlane.h @@ -57,7 +57,7 @@ public: }; public: - DECLARE_IMAGEASSET_REFACTOR(afxZodiacPlaneData, Texture, AFX_GFXZodiacTextureProfile) + DECLARE_IMAGEASSET(afxZodiacPlaneData, Texture, AFX_GFXZodiacTextureProfile) F32 radius_xy; F32 start_ang; diff --git a/Engine/source/environment/VolumetricFog.cpp b/Engine/source/environment/VolumetricFog.cpp index ea742a656..05ee73da0 100644 --- a/Engine/source/environment/VolumetricFog.cpp +++ b/Engine/source/environment/VolumetricFog.cpp @@ -181,7 +181,7 @@ void VolumetricFog::initPersistFields() endGroup("VolumetricFogData"); addGroup("VolumetricFogModulation"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, VolumetricFog, "A texture which contains Fogdensity modulator in the red channel and color with 1-green channel. No texture disables modulation."); + INITPERSISTFIELD_IMAGEASSET(Texture, VolumetricFog, "A texture which contains Fogdensity modulator in the red channel and color with 1-green channel. No texture disables modulation."); addFieldV("tiles", TypeRangedF32, Offset(mTexTiles, VolumetricFog), &CommonValidators::PositiveFloat, "How many times the texture is mapped to the object."); diff --git a/Engine/source/environment/VolumetricFog.h b/Engine/source/environment/VolumetricFog.h index 80a349cb6..42f085eab 100644 --- a/Engine/source/environment/VolumetricFog.h +++ b/Engine/source/environment/VolumetricFog.h @@ -162,7 +162,7 @@ class VolumetricFog : public SceneObject F32 mInvScale; // Fog Modulation data - DECLARE_IMAGEASSET_NET_REFACTOR(VolumetricFog, Texture, GFXStaticTextureSRGBProfile, FogModulationMask) + DECLARE_IMAGEASSET_NET(VolumetricFog, Texture, GFXStaticTextureSRGBProfile, FogModulationMask) bool mIsTextured; F32 mTexTiles; diff --git a/Engine/source/environment/basicClouds.cpp b/Engine/source/environment/basicClouds.cpp index 83e38a11f..02286bccc 100644 --- a/Engine/source/environment/basicClouds.cpp +++ b/Engine/source/environment/basicClouds.cpp @@ -174,7 +174,7 @@ void BasicClouds::initPersistFields() addField( "layerEnabled", TypeBool, Offset( mLayerEnabled, BasicClouds ), TEX_COUNT, "Enable or disable rendering of this layer." ); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(Texture, TEX_COUNT, BasicClouds, "Texture for this layer."); + INITPERSISTFIELD_IMAGEASSET_ARRAY(Texture, TEX_COUNT, BasicClouds, "Texture for this layer."); addFieldV( "texScale", TypeRangedF32, Offset( mTexScale, BasicClouds ), &CommonValidators::PositiveFloat, TEX_COUNT, "Texture repeat for this layer." ); diff --git a/Engine/source/environment/basicClouds.h b/Engine/source/environment/basicClouds.h index 8157212ff..1fb2d06e0 100644 --- a/Engine/source/environment/basicClouds.h +++ b/Engine/source/environment/basicClouds.h @@ -94,7 +94,7 @@ protected: static U32 smVertCount; static U32 smTriangleCount; - DECLARE_IMAGEASSET_ARRAY_NET_REFACTOR(BasicClouds, Texture, GFXStaticTextureSRGBProfile, TEX_COUNT, -1) + DECLARE_IMAGEASSET_ARRAY_NET(BasicClouds, Texture, GFXStaticTextureSRGBProfile, TEX_COUNT, -1) GFXStateBlockRef mStateblock; diff --git a/Engine/source/environment/cloudLayer.cpp b/Engine/source/environment/cloudLayer.cpp index f63893e30..f65782c12 100644 --- a/Engine/source/environment/cloudLayer.cpp +++ b/Engine/source/environment/cloudLayer.cpp @@ -190,7 +190,7 @@ void CloudLayer::initPersistFields() docsURL; addGroup( "CloudLayer" ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Texture, CloudLayer, "An RGBA texture which should contain normals and opacity (density).") + INITPERSISTFIELD_IMAGEASSET(Texture, CloudLayer, "An RGBA texture which should contain normals and opacity (density).") addArray( "Textures", TEX_COUNT ); diff --git a/Engine/source/environment/cloudLayer.h b/Engine/source/environment/cloudLayer.h index a07e00c14..3f7dca6b4 100644 --- a/Engine/source/environment/cloudLayer.h +++ b/Engine/source/environment/cloudLayer.h @@ -98,7 +98,7 @@ protected: public: - DECLARE_IMAGEASSET_NET_REFACTOR(CloudLayer,Texture, GFXStaticTextureSRGBProfile, CloudLayerMask) + DECLARE_IMAGEASSET_NET(CloudLayer,Texture, GFXStaticTextureSRGBProfile, CloudLayerMask) GFXShaderRef mShader; diff --git a/Engine/source/environment/waterObject.cpp b/Engine/source/environment/waterObject.cpp index ac666a274..b18fc4037 100644 --- a/Engine/source/environment/waterObject.cpp +++ b/Engine/source/environment/waterObject.cpp @@ -296,7 +296,7 @@ void WaterObject::initPersistFields() addFieldV( "overallWaveMagnitude", TypeRangedF32, Offset( mOverallWaveMagnitude, WaterObject ), &CommonValidators::PositiveFloat, "Master variable affecting entire body" " of water's undulation" ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(RippleTex, WaterObject, "Normal map used to simulate small surface ripples"); + INITPERSISTFIELD_IMAGEASSET(RippleTex, WaterObject, "Normal map used to simulate small surface ripples"); addArray( "Ripples (texture animation)", MAX_WAVES ); @@ -310,7 +310,7 @@ void WaterObject::initPersistFields() addFieldV( "overallRippleMagnitude", TypeRangedF32, Offset( mOverallRippleMagnitude, WaterObject ), &CommonValidators::PositiveFloat, "Master variable affecting entire surface"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(FoamTex, WaterObject, "Diffuse texture for foam in shallow water (advanced lighting only)"); + INITPERSISTFIELD_IMAGEASSET(FoamTex, WaterObject, "Diffuse texture for foam in shallow water (advanced lighting only)"); addArray( "Foam", MAX_FOAM ); @@ -362,7 +362,7 @@ void WaterObject::initPersistFields() addGroup( "Misc" ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(DepthGradientTex, WaterObject, "1D texture defining the base water color by depth"); + INITPERSISTFIELD_IMAGEASSET(DepthGradientTex, WaterObject, "1D texture defining the base water color by depth"); addFieldV( "depthGradientMax", TypeRangedF32, Offset( mDepthGradientMax, WaterObject ), &CommonValidators::PositiveFloat, "Depth in world units, the max range of the color gradient texture." ); diff --git a/Engine/source/environment/waterObject.h b/Engine/source/environment/waterObject.h index ceb490bdf..c925f4a07 100644 --- a/Engine/source/environment/waterObject.h +++ b/Engine/source/environment/waterObject.h @@ -269,9 +269,9 @@ protected: F32 mDepthGradientMax; // Other textures - DECLARE_IMAGEASSET_NET_REFACTOR(WaterObject, RippleTex, GFXStaticTextureProfile, TextureMask) - DECLARE_IMAGEASSET_NET_REFACTOR(WaterObject, FoamTex, GFXStaticTextureSRGBProfile, TextureMask) - DECLARE_IMAGEASSET_NET_REFACTOR(WaterObject, DepthGradientTex, GFXStaticTextureSRGBProfile, TextureMask) + DECLARE_IMAGEASSET_NET(WaterObject, RippleTex, GFXStaticTextureProfile, TextureMask) + DECLARE_IMAGEASSET_NET(WaterObject, FoamTex, GFXStaticTextureSRGBProfile, TextureMask) + DECLARE_IMAGEASSET_NET(WaterObject, DepthGradientTex, GFXStaticTextureSRGBProfile, TextureMask) StringTableEntry mCubemapName; diff --git a/Engine/source/gfx/sim/cubemapData.cpp b/Engine/source/gfx/sim/cubemapData.cpp index 494ba1852..d257027b2 100644 --- a/Engine/source/gfx/sim/cubemapData.cpp +++ b/Engine/source/gfx/sim/cubemapData.cpp @@ -70,7 +70,7 @@ ConsoleDocClass( CubemapData, void CubemapData::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(CubeMapFace, 6, CubemapData, "@brief The 6 cubemap face textures for a static cubemap.\n\n" + INITPERSISTFIELD_IMAGEASSET_ARRAY(CubeMapFace, 6, CubemapData, "@brief The 6 cubemap face textures for a static cubemap.\n\n" "They are in the following order:\n" " - cubeFace[0] is -X\n" " - cubeFace[1] is +X\n" @@ -79,7 +79,7 @@ void CubemapData::initPersistFields() " - cubeFace[4] is -Y\n" " - cubeFace[5] is +Y\n"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(CubeMap, CubemapData, "@brief Cubemap dds Image Asset.\n\n"); + INITPERSISTFIELD_IMAGEASSET(CubeMap, CubemapData, "@brief Cubemap dds Image Asset.\n\n"); } bool CubemapData::onAdd() diff --git a/Engine/source/gfx/sim/cubemapData.h b/Engine/source/gfx/sim/cubemapData.h index 8fea60641..2d2385deb 100644 --- a/Engine/source/gfx/sim/cubemapData.h +++ b/Engine/source/gfx/sim/cubemapData.h @@ -73,9 +73,9 @@ public: GFXTexHandle* getCubeFaceTexture(U32 faceIdx) { return &mCubeMapFaceTex[faceIdx]; } protected: - DECLARE_IMAGEASSET_REFACTOR(CubemapData, CubeMap, GFXStaticTextureSRGBProfile); + DECLARE_IMAGEASSET(CubemapData, CubeMap, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_ARRAY_REFACTOR(CubemapData, CubeMapFace, GFXStaticTextureSRGBProfile, 6); + DECLARE_IMAGEASSET_ARRAY(CubemapData, CubeMapFace, GFXStaticTextureSRGBProfile, 6); GFXTexHandle mCubeMapFaceTex[6]; GFXTexHandle mDepthBuff; diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp index 139c8f65d..e6f063428 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp @@ -141,7 +141,7 @@ void GuiBitmapButtonCtrl::initPersistFields() docsURL; addGroup( "Bitmap" ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiBitmapButtonCtrl,"Texture file to display on this button.\n" + INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiBitmapButtonCtrl,"Texture file to display on this button.\n" "If useStates is false, this will be the file that renders on the control. Otherwise, this will " "specify the default texture name to which the various state and modifier suffixes are appended " "to find the per-state and per-modifier (if enabled) textures.") diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp index eeb5dc6e3..9d0093802 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp @@ -127,7 +127,7 @@ void GuiIconButtonCtrl::initPersistFields() addField( "buttonMargin", TypePoint2I, Offset( mButtonMargin, GuiIconButtonCtrl ),"Margin area around the button.\n"); addProtectedField( "iconBitmap", TypeImageFilename, Offset( mBitmapAsset, GuiIconButtonCtrl ), &_setBitmapData, &defaultProtectedGetFn, "Bitmap file for the icon to display on the button.\n", AbstractClassRep::FIELD_HideInInspectors); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiIconButtonCtrl, "Bitmap file for the icon to display on the button.\n"); + INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiIconButtonCtrl, "Bitmap file for the icon to display on the button.\n"); addField( "iconLocation", TYPEID< IconLocation >(), Offset( mIconLocation, GuiIconButtonCtrl ),"Where to place the icon on the control. Options are 0 (None), 1 (Left), 2 (Right), 3 (Center).\n"); addField( "sizeIconToButton", TypeBool, Offset( mFitBitmapToButton, GuiIconButtonCtrl ),"If true, the icon will be scaled to be the same size as the button.\n"); diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.h b/Engine/source/gui/buttons/guiIconButtonCtrl.h index da5b08ca2..786997bb1 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.h +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.h @@ -42,7 +42,7 @@ private: protected: - DECLARE_IMAGEASSET_REFACTOR(GuiIconButtonCtrl, Bitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiIconButtonCtrl, Bitmap, GFXDefaultGUIProfile) S32 mIconLocation; S32 mTextLocation; diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp index 1becb6f49..a2b711956 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp @@ -55,9 +55,9 @@ GuiToolboxButtonCtrl::GuiToolboxButtonCtrl() void GuiToolboxButtonCtrl::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(NormalBitmap, GuiToolboxButtonCtrl, ""); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(LoweredBitmap, GuiToolboxButtonCtrl, ""); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(HoverBitmap, GuiToolboxButtonCtrl, ""); + INITPERSISTFIELD_IMAGEASSET(NormalBitmap, GuiToolboxButtonCtrl, ""); + INITPERSISTFIELD_IMAGEASSET(LoweredBitmap, GuiToolboxButtonCtrl, ""); + INITPERSISTFIELD_IMAGEASSET(HoverBitmap, GuiToolboxButtonCtrl, ""); Parent::initPersistFields(); } diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.h b/Engine/source/gui/buttons/guiToolboxButtonCtrl.h index c5319e9dd..893fc156d 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.h +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.h @@ -39,9 +39,9 @@ private: protected: - DECLARE_IMAGEASSET_REFACTOR(GuiToolboxButtonCtrl, NormalBitmap, GFXDefaultGUIProfile) - DECLARE_IMAGEASSET_REFACTOR(GuiToolboxButtonCtrl, LoweredBitmap, GFXDefaultGUIProfile) - DECLARE_IMAGEASSET_REFACTOR(GuiToolboxButtonCtrl, HoverBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, NormalBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, LoweredBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, HoverBitmap, GFXDefaultGUIProfile) void renderButton(GFXTexHandle texture, Point2I &offset, const RectI& updateRect); void renderStateRect( GFXTexHandle texture, const RectI& rect ); diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 5c42b0894..bcf667361 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -70,7 +70,7 @@ void GuiBitmapCtrl::initPersistFields() docsURL; addGroup("Bitmap"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiBitmapCtrl, "The bitmap to render in this BitmapCtrl.") + INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiBitmapCtrl, "The bitmap to render in this BitmapCtrl.") addField("color", TypeColorI, Offset(mColor, GuiBitmapCtrl), "color mul"); addField("wrap", TypeBool, Offset(mWrap, GuiBitmapCtrl), "If true, the bitmap is tiled inside the control rather than stretched to fit."); diff --git a/Engine/source/gui/controls/guiBitmapCtrl.h b/Engine/source/gui/controls/guiBitmapCtrl.h index c953fb3b1..adf6f5322 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.h +++ b/Engine/source/gui/controls/guiBitmapCtrl.h @@ -39,7 +39,7 @@ protected: /// Name of the bitmap file. If this is 'texhandle' the bitmap is not loaded /// from a file but rather set explicitly on the control. - DECLARE_IMAGEASSET_REFACTOR(GuiBitmapCtrl, Bitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiBitmapCtrl, Bitmap, GFXDefaultGUIProfile) Point2I mStartPoint; ColorI mColor; diff --git a/Engine/source/gui/controls/guiGameSettingsCtrl.cpp b/Engine/source/gui/controls/guiGameSettingsCtrl.cpp index c79769318..b782f3024 100644 --- a/Engine/source/gui/controls/guiGameSettingsCtrl.cpp +++ b/Engine/source/gui/controls/guiGameSettingsCtrl.cpp @@ -826,9 +826,9 @@ IMPLEMENT_CALLBACK(GuiGameSettingsCtrl, onAxisEvent, void, (const char* device, void GuiGameSettingsCtrl::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(KeybindBitmap, GuiGameSettingsCtrl, "Bitmap used to display the bound key for this keybind option."); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode."); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode."); + INITPERSISTFIELD_IMAGEASSET(KeybindBitmap, GuiGameSettingsCtrl, "Bitmap used to display the bound key for this keybind option."); + INITPERSISTFIELD_IMAGEASSET(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode."); + INITPERSISTFIELD_IMAGEASSET(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode."); addFieldV("arrowSize", TypeRangedS32, Offset(mArrowSize, GuiGameSettingsCtrl), &CommonValidators::PositiveInt, "Size of the arrow buttons' extents"); diff --git a/Engine/source/gui/controls/guiGameSettingsCtrl.h b/Engine/source/gui/controls/guiGameSettingsCtrl.h index dbcdc5efc..6c2f69d70 100644 --- a/Engine/source/gui/controls/guiGameSettingsCtrl.h +++ b/Engine/source/gui/controls/guiGameSettingsCtrl.h @@ -72,9 +72,9 @@ protected: Point2F mRange; ///< When working as a slider, this sets our min/max range //Keybind option - DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, KeybindBitmap, GFXDefaultGUIProfile) - DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, PreviousBitmap, GFXDefaultGUIProfile) - DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, NextBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiGameSettingsCtrl, KeybindBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiGameSettingsCtrl, PreviousBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiGameSettingsCtrl, NextBitmap, GFXDefaultGUIProfile) S32 mArrowSize; S32 mColumnSplit; //Padding between the leftmost edge of the control, and the left side of the 'option'. diff --git a/Engine/source/gui/controls/guiPopUpCtrl.h b/Engine/source/gui/controls/guiPopUpCtrl.h index 3f7f5c02b..0528612ea 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.h +++ b/Engine/source/gui/controls/guiPopUpCtrl.h @@ -126,7 +126,7 @@ protected: NumBitmapModes = 2 }; - DECLARE_IMAGEASSET_ARRAY_REFACTOR(GuiPopUpMenuCtrl, Bitmap, GFXDefaultGUIProfile, NumBitmapModes) + DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrl, Bitmap, GFXDefaultGUIProfile, NumBitmapModes) Point2I mBitmapBounds; // Added S32 mIdMax; diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.h b/Engine/source/gui/controls/guiPopUpCtrlEx.h index 9e8fddc87..b6501d991 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.h +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.h @@ -131,7 +131,7 @@ class GuiPopUpMenuCtrlEx : public GuiTextCtrl NumBitmapModes = 2 }; - DECLARE_IMAGEASSET_ARRAY_REFACTOR(GuiPopUpMenuCtrlEx, Bitmap, GFXDefaultGUIProfile, NumBitmapModes) + DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrlEx, Bitmap, GFXDefaultGUIProfile, NumBitmapModes) Point2I mBitmapBounds; // Added diff --git a/Engine/source/gui/core/guiTypes.cpp b/Engine/source/gui/core/guiTypes.cpp index bcfcf2123..5bccfce36 100644 --- a/Engine/source/gui/core/guiTypes.cpp +++ b/Engine/source/gui/core/guiTypes.cpp @@ -91,7 +91,7 @@ void GuiCursor::initPersistFields() addField("hotSpot", TypePoint2I, Offset(mHotSpot, GuiCursor), "The location of the cursor's hot spot (which pixel carries the click)."); addField("renderOffset",TypePoint2F, Offset(mRenderOffset, GuiCursor), "Offset of the bitmap, where 0 signifies left edge of the bitmap, 1, the right. Similarly for the Y-component."); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiCursor, "name of the bitmap for the cursor."); + INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiCursor, "name of the bitmap for the cursor."); Parent::initPersistFields(); } diff --git a/Engine/source/gui/core/guiTypes.h b/Engine/source/gui/core/guiTypes.h index 4ede98303..9c21e54de 100644 --- a/Engine/source/gui/core/guiTypes.h +++ b/Engine/source/gui/core/guiTypes.h @@ -348,7 +348,7 @@ class GuiCursor : public SimObject private: typedef SimObject Parent; - DECLARE_IMAGEASSET_REFACTOR(GuiCursor, Bitmap, GFXGuiCursorProfile) + DECLARE_IMAGEASSET(GuiCursor, Bitmap, GFXGuiCursorProfile) Point2I mHotSpot; Point2F mRenderOffset; @@ -458,7 +458,7 @@ public: /// public: - DECLARE_IMAGEASSET_REFACTOR(GuiControlProfile, Bitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiControlProfile, Bitmap, GFXDefaultGUIProfile) GFXTexHandle mBitmap; StringTableEntry mBitmapName; diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp index 07883e246..b926205f9 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp @@ -67,7 +67,7 @@ void GuiChunkedBitmapCtrl::initPersistFields() { docsURL; addGroup("GuiChunkedBitmapCtrl"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiChunkedBitmapCtrl, "This is the bitmap to render to the control."); + INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiChunkedBitmapCtrl, "This is the bitmap to render to the control."); addField( "useVariable", TypeBool, Offset( mUseVariable, GuiChunkedBitmapCtrl ), "This decides whether to use the \"bitmap\" file " "or a bitmap stored in \"variable\""); diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.h b/Engine/source/gui/game/guiChunkedBitmapCtrl.h index 077087991..e12e0c4c1 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.h +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.h @@ -17,7 +17,7 @@ private: protected: - DECLARE_IMAGEASSET_REFACTOR(GuiChunkedBitmapCtrl, Bitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiChunkedBitmapCtrl, Bitmap, GFXDefaultGUIProfile) bool mUseVariable; bool mTile; diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp index 183634028..4689d70c5 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp @@ -131,7 +131,7 @@ GuiProgressBitmapCtrl::GuiProgressBitmapCtrl() void GuiProgressBitmapCtrl::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiProgressBitmapCtrl, "Bitmap file to use for rendering the progress bar.\n\n" + INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiProgressBitmapCtrl, "Bitmap file to use for rendering the progress bar.\n\n" "If the profile assigned to the control already has a bitmap assigned, this property need not be " "set in which case the bitmap from the profile is used."); diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.h b/Engine/source/gui/game/guiProgressBitmapCtrl.h index 6d8f1bd52..c134ae1a8 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.h +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.h @@ -47,7 +47,7 @@ class GuiProgressBitmapCtrl : public GuiTextCtrl F32 mProgress; - DECLARE_IMAGEASSET_REFACTOR(GuiProgressBitmapCtrl, Bitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiProgressBitmapCtrl, Bitmap, GFXDefaultGUIProfile) bool mUseVariable; bool mTile; diff --git a/Engine/source/gui/worldEditor/guiMissionArea.cpp b/Engine/source/gui/worldEditor/guiMissionArea.cpp index c951ea8b9..8963911da 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.cpp +++ b/Engine/source/gui/worldEditor/guiMissionArea.cpp @@ -88,7 +88,7 @@ void GuiMissionAreaCtrl::initPersistFields() docsURL; addField( "squareBitmap", TypeBool, Offset(mSquareBitmap, GuiMissionAreaCtrl)); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(HandleBitmap, GuiMissionAreaCtrl, "Bitmap for the mission area handles.\n"); + INITPERSISTFIELD_IMAGEASSET(HandleBitmap, GuiMissionAreaCtrl, "Bitmap for the mission area handles.\n"); addField( "missionBoundsColor", TypeColorI, Offset(mMissionBoundsColor, GuiMissionAreaCtrl)); addField( "cameraColor", TypeColorI, Offset(mCameraColor, GuiMissionAreaCtrl)); diff --git a/Engine/source/gui/worldEditor/guiMissionArea.h b/Engine/source/gui/worldEditor/guiMissionArea.h index 6400e248d..302bda930 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.h +++ b/Engine/source/gui/worldEditor/guiMissionArea.h @@ -63,7 +63,7 @@ protected: GFXStateBlockRef mBlendStateBlock; GFXStateBlockRef mSolidStateBlock; - DECLARE_IMAGEASSET_REFACTOR(GuiMissionAreaCtrl, HandleBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, GFXDefaultGUIProfile) Point2I mHandleTextureSize; Point2F mHandleTextureHalfSize; diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index d32f24d44..d4008a95b 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -2839,9 +2839,9 @@ void WorldEditor::initPersistFields() addField( "renderObjHandle", TypeBool, Offset(mRenderObjHandle, WorldEditor) ); addField( "renderSelectionBox", TypeBool, Offset(mRenderSelectionBox, WorldEditor) ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(SelectHandle, WorldEditor, ""); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(DefaultHandle, WorldEditor, ""); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(LockedHandle, WorldEditor, ""); + INITPERSISTFIELD_IMAGEASSET(SelectHandle, WorldEditor, ""); + INITPERSISTFIELD_IMAGEASSET(DefaultHandle, WorldEditor, ""); + INITPERSISTFIELD_IMAGEASSET(LockedHandle, WorldEditor, ""); endGroup( "Rendering" ); diff --git a/Engine/source/gui/worldEditor/worldEditor.h b/Engine/source/gui/worldEditor/worldEditor.h index f11e23c1a..40cc888a1 100644 --- a/Engine/source/gui/worldEditor/worldEditor.h +++ b/Engine/source/gui/worldEditor/worldEditor.h @@ -328,9 +328,9 @@ class WorldEditor : public EditTSCtrl ColorI mPopupBackgroundColor; ColorI mPopupTextColor; - DECLARE_IMAGEASSET_REFACTOR(WorldEditor, SelectHandle, GFXStaticTextureSRGBProfile) - DECLARE_IMAGEASSET_REFACTOR(WorldEditor, DefaultHandle, GFXStaticTextureSRGBProfile) - DECLARE_IMAGEASSET_REFACTOR(WorldEditor, LockedHandle, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(WorldEditor, SelectHandle, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(WorldEditor, DefaultHandle, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(WorldEditor, LockedHandle, GFXStaticTextureSRGBProfile) ColorI mObjectTextColor; bool mObjectsUseBoxCenter; diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 98bdb9729..0e32056d1 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -242,28 +242,28 @@ void Material::initPersistFields() addArray("Stages", MAX_STAGES); addGroup("Basic Texture Maps"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(DiffuseMap, MAX_STAGES, Material, "Albedo"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(DiffuseMap, MAX_STAGES, Material, "Albedo"); addField("diffuseColor", TypeColorF, Offset(mDiffuse, Material), MAX_STAGES, "This color is multiplied against the diffuse texture color. If no diffuse texture " "is present this is the material color."); addField("diffuseMapSRGB", TypeBool, Offset(mDiffuseMapSRGB, Material), MAX_STAGES, "Enable sRGB for the diffuse color texture map."); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(NormalMap, MAX_STAGES, Material, "NormalMap"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(NormalMap, MAX_STAGES, Material, "NormalMap"); endGroup("Basic Texture Maps"); addGroup("Light Influence Maps"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(ORMConfigMap, MAX_STAGES, Material, "AO|Roughness|metalness map"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(ORMConfigMap, MAX_STAGES, Material, "AO|Roughness|metalness map"); addField("isSRGb", TypeBool, Offset(mIsSRGb, Material), MAX_STAGES, "Substance Designer Workaround."); addField("invertRoughness", TypeBool, Offset(mInvertRoughness, Material), MAX_STAGES, "Treat Roughness as Roughness"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(AOMap, MAX_STAGES, Material, "AOMap"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(RoughMap, MAX_STAGES, Material, "RoughMap (also needs MetalMap)"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(MetalMap, MAX_STAGES, Material, "MetalMap (also needs RoughMap)"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(GlowMap, MAX_STAGES, Material, "GlowMap (needs Albedo)"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(AOMap, MAX_STAGES, Material, "AOMap"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(RoughMap, MAX_STAGES, Material, "RoughMap (also needs MetalMap)"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(MetalMap, MAX_STAGES, Material, "MetalMap (also needs RoughMap)"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(GlowMap, MAX_STAGES, Material, "GlowMap (needs Albedo)"); addFieldV("AOChan", TypeRangedS32, Offset(mAOChan, Material), &bmpChanRange, MAX_STAGES, "The input channel AO maps use."); @@ -281,18 +281,18 @@ void Material::initPersistFields() endGroup("Light Influence Maps"); addGroup("Advanced Texture Maps"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(DetailMap, MAX_STAGES, Material, "DetailMap"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(DetailMap, MAX_STAGES, Material, "DetailMap"); addField("detailScale", TypePoint2F, Offset(mDetailScale, Material), MAX_STAGES, "The scale factor for the detail map."); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(DetailNormalMap, MAX_STAGES, Material, "DetailNormalMap"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(DetailNormalMap, MAX_STAGES, Material, "DetailNormalMap"); addFieldV("detailNormalMapStrength", TypeRangedF32, Offset(mDetailNormalMapStrength, Material), &CommonValidators::PositiveFloat, MAX_STAGES, "Used to scale the strength of the detail normal map when blended with the base normal map."); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(OverlayMap, MAX_STAGES, Material, "Overlay"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(LightMap, MAX_STAGES, Material, "LightMap"); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(ToneMap, MAX_STAGES, Material, "ToneMap"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(OverlayMap, MAX_STAGES, Material, "Overlay"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(LightMap, MAX_STAGES, Material, "LightMap"); + INITPERSISTFIELD_IMAGEASSET_ARRAY(ToneMap, MAX_STAGES, Material, "ToneMap"); endGroup("Advanced Texture Maps"); addGroup("Accumulation Properties"); @@ -807,15 +807,15 @@ bool Material::_setAccuEnabled(void* object, const char* index, const char* data //material.getDiffuseMap(%layer); //returns the raw file referenced //material.getDiffuseMapAsset(%layer); //returns the asset id //material.setDiffuseMap(%texture, %layer); //tries to set the asset and failing that attempts a flat file reference -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, DiffuseMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, NormalMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, DetailNormalMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, OverlayMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, LightMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, ToneMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, DetailMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, ORMConfigMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, RoughMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, AOMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, MetalMap, Material::Constants::MAX_STAGES) -DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(Material, GlowMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, DiffuseMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, NormalMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, DetailNormalMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, OverlayMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, LightMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, ToneMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, DetailMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, ORMConfigMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, RoughMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, AOMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, MetalMap, Material::Constants::MAX_STAGES) +DEF_IMAGEASSET_ARRAY_BINDS(Material, GlowMap, Material::Constants::MAX_STAGES) diff --git a/Engine/source/materials/materialDefinition.h b/Engine/source/materials/materialDefinition.h index 994c11ffe..b76aadd6f 100644 --- a/Engine/source/materials/materialDefinition.h +++ b/Engine/source/materials/materialDefinition.h @@ -208,18 +208,18 @@ public: //----------------------------------------------------------------------- // Data //----------------------------------------------------------------------- - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, DiffuseMap, GFXStaticTextureSRGBProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, NormalMap, GFXNormalMapProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, DetailNormalMap, GFXNormalMapProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, OverlayMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, LightMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, ToneMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, DetailMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, ORMConfigMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, AOMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, RoughMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, MetalMap, GFXStaticTextureProfile, MAX_STAGES) - DECLARE_IMAGEASSET_ARRAY_REFACTOR(Material, GlowMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, DiffuseMap, GFXStaticTextureSRGBProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, NormalMap, GFXNormalMapProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, DetailNormalMap, GFXNormalMapProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, OverlayMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, LightMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, ToneMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, DetailMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, ORMConfigMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, AOMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, RoughMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, MetalMap, GFXStaticTextureProfile, MAX_STAGES) + DECLARE_IMAGEASSET_ARRAY(Material, GlowMap, GFXStaticTextureProfile, MAX_STAGES) bool mDiffuseMapSRGB[MAX_STAGES]; // SRGB diffuse bool mIsSRGb[MAX_STAGES]; // SRGB ORM diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index 98a9e569a..e4c09d132 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -875,13 +875,14 @@ void ProcessedShaderMaterial::setTextureStages( SceneRenderState *state, const S case Material::TexTarget: { texTarget = rpd->mTexSlot[i].texTarget; + texObject = mMaterial->getDiffuseMapAsset(0)->getTexture(&GFXStaticTextureSRGBProfile); if ( !texTarget ) { // try again. texTarget = mMaterial->getDiffuseMapAsset(0)->getNamedTarget(); if (!texTarget) { - GFX->setTexture(i, NULL); + GFX->setTexture(i, texObject); break; } else @@ -889,8 +890,6 @@ void ProcessedShaderMaterial::setTextureStages( SceneRenderState *state, const S rpd->mTexSlot[i].texTarget = texTarget; } } - - texObject = texTarget->getTexture(); // If no texture is available then map the default 2x2 // black texture to it. This at least will ensure that @@ -1281,35 +1280,35 @@ void ProcessedShaderMaterial::setNodeTransforms(const MatrixF *transforms, const void ProcessedShaderMaterial::setCustomShaderData(Vector &shaderData, const U32 pass) { - PROFILE_SCOPE(ProcessedShaderMaterial_setCustomShaderData); + PROFILE_SCOPE(ProcessedShaderMaterial_setCustomShaderData); - GFXShaderConstBuffer* shaderConsts = _getShaderConstBuffer(pass); - ShaderConstHandles* handles = _getShaderConstHandles(pass); + GFXShaderConstBuffer* shaderConsts = _getShaderConstBuffer(pass); + ShaderConstHandles* handles = _getShaderConstHandles(pass); - for (U32 i = 0; i < shaderData.size(); i++) - { - //roll through and try setting our data! - for (U32 h = 0; h < handles->mCustomHandles.size(); ++h) - { - if (handles->mCustomHandles[h].handleName == shaderData[i].getHandleName()) - { - if (handles->mCustomHandles[h].handle->isValid()) - { - CustomShaderBindingData::UniformType type = shaderData[i].getType(); + for (U32 i = 0; i < shaderData.size(); i++) + { + //roll through and try setting our data! + for (U32 h = 0; h < handles->mCustomHandles.size(); ++h) + { + if (handles->mCustomHandles[h].handleName == shaderData[i].getHandleName()) + { + if (handles->mCustomHandles[h].handle->isValid()) + { + CustomShaderBindingData::UniformType type = shaderData[i].getType(); - if (type == CustomShaderBindingData::Float) - shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat()); - else if (type == CustomShaderBindingData::Float2) - shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat2()); - else if (type == CustomShaderBindingData::Float3) - shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat3()); - else if (type == CustomShaderBindingData::Float4) - shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat4()); - break; - } - } - } - } + if (type == CustomShaderBindingData::Float) + shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat()); + else if (type == CustomShaderBindingData::Float2) + shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat2()); + else if (type == CustomShaderBindingData::Float3) + shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat3()); + else if (type == CustomShaderBindingData::Float4) + shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat4()); + break; + } + } + } + } } void ProcessedShaderMaterial::setSceneInfo(SceneRenderState * state, const SceneData& sgData, U32 pass) diff --git a/Engine/source/postFx/postEffect.cpp b/Engine/source/postFx/postEffect.cpp index 8c87d601a..ef9ef2fa6 100644 --- a/Engine/source/postFx/postEffect.cpp +++ b/Engine/source/postFx/postEffect.cpp @@ -553,7 +553,7 @@ void PostEffect::initPersistFields() "Specifies how the viewport should be set up for a target texture." ); addProtectedField("Texture", TypeImageFilename, Offset(mTextureAsset, PostEffect), _setTextureData, &defaultProtectedGetFn, NumTextures, "Input textures to this effect(samplers).\n", AbstractClassRep::FIELD_HideInInspectors); - INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(Texture, NumTextures, PostEffect, "Input textures to this effect ( samplers ).\n" + INITPERSISTFIELD_IMAGEASSET_ARRAY(Texture, NumTextures, PostEffect, "Input textures to this effect ( samplers ).\n" "@see PFXTextureIdentifiers"); addField("textureSRGB", TypeBool, Offset(mTexSRGB, PostEffect), NumTextures, diff --git a/Engine/source/postFx/postEffect.h b/Engine/source/postFx/postEffect.h index 4f9a1c2c8..456b7578d 100644 --- a/Engine/source/postFx/postEffect.h +++ b/Engine/source/postFx/postEffect.h @@ -90,7 +90,7 @@ public: protected: - DECLARE_IMAGEASSET_ARRAY_REFACTOR(PostEffect, Texture, GFXStaticTextureSRGBProfile, NumTextures); + DECLARE_IMAGEASSET_ARRAY(PostEffect, Texture, GFXStaticTextureSRGBProfile, NumTextures); GFXTextureProfile* mTextureProfile[NumTextures]; GFXTexHandle mTexture[NumTextures]; diff --git a/Engine/source/terrain/terrMaterial.cpp b/Engine/source/terrain/terrMaterial.cpp index 694ce7dee..33e625f99 100644 --- a/Engine/source/terrain/terrMaterial.cpp +++ b/Engine/source/terrain/terrMaterial.cpp @@ -92,10 +92,10 @@ FRangeValidator hardnessValidator(0.0f, 0.999f); void TerrainMaterial::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET_REFACTOR(DiffuseMap, TerrainMaterial,"Base Albedo stretched over the whole map"); + INITPERSISTFIELD_IMAGEASSET(DiffuseMap, TerrainMaterial,"Base Albedo stretched over the whole map"); addFieldV( "diffuseSize", TypeRangedF32, Offset( mDiffuseSize, TerrainMaterial ), &CommonValidators::PositiveFloat, "Used to scale the diffuse map to the material square" ); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(NormalMap, TerrainMaterial,"NormalMap"); + INITPERSISTFIELD_IMAGEASSET(NormalMap, TerrainMaterial,"NormalMap"); addFieldV( "parallaxScale", TypeRangedF32, Offset( mParallaxScale, TerrainMaterial ), &CommonValidators::PositiveFloat, "Used to scale the height from the normal map to give some self " "occlusion effect (aka parallax) to the terrain material" ); @@ -109,20 +109,20 @@ void TerrainMaterial::initPersistFields() addFieldV("blendHeightHardness", TypeRangedF32, Offset(mBlendHardness, TerrainMaterial), &hardnessValidator, "How sharply this layer blends with other textures." "0->1, soft->hard."); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(DetailMap, TerrainMaterial, "Raises and lowers the RGB result of the Base Albedo up close."); + INITPERSISTFIELD_IMAGEASSET(DetailMap, TerrainMaterial, "Raises and lowers the RGB result of the Base Albedo up close."); addFieldV( "detailSize", TypeRangedF32, Offset( mDetailSize, TerrainMaterial ), &CommonValidators::PositiveFloat, "Used to scale the detail map to the material square" ); addFieldV( "detailStrength", TypeRangedF32, Offset( mDetailStrength, TerrainMaterial ), &CommonValidators::PositiveFloat, "Exponentially sharpens or lightens the detail map rendering on the material" ); addFieldV( "detailDistance", TypeRangedF32, Offset( mDetailDistance, TerrainMaterial ), &CommonValidators::PositiveFloat, "Changes how far camera can see the detail map rendering on the material" ); addField( "useSideProjection", TypeBool, Offset( mSideProjection, TerrainMaterial ),"Makes that terrain material project along the sides of steep " "slopes instead of projected downwards"); - INITPERSISTFIELD_IMAGEASSET_REFACTOR(ORMConfigMap, TerrainMaterial, "AO|Roughness|metalness map (uses DetailMap UV Coords)"); + INITPERSISTFIELD_IMAGEASSET(ORMConfigMap, TerrainMaterial, "AO|Roughness|metalness map (uses DetailMap UV Coords)"); addField("isSRGB", TypeBool, Offset(mIsSRGB, TerrainMaterial), "Is the PBR Config map's image in sRGB format?"); addField("invertRoughness", TypeBool, Offset(mInvertRoughness, TerrainMaterial), "Should the roughness channel of the PBR Config map be inverted?"); //Macro maps additions - INITPERSISTFIELD_IMAGEASSET_REFACTOR(MacroMap, TerrainMaterial, "Raises and lowers the RGB result of the Base Albedo at a distance."); + INITPERSISTFIELD_IMAGEASSET(MacroMap, TerrainMaterial, "Raises and lowers the RGB result of the Base Albedo at a distance."); addFieldV( "macroSize", TypeRangedF32, Offset( mMacroSize, TerrainMaterial ), &CommonValidators::PositiveFloat, "Used to scale the Macro map to the material square" ); addFieldV( "macroStrength", TypeRangedF32, Offset( mMacroStrength, TerrainMaterial ), &CommonValidators::PositiveFloat, "Exponentially sharpens or lightens the Macro map rendering on the material" ); addFieldV( "macroDistance", TypeRangedF32, Offset( mMacroDistance, TerrainMaterial ), &CommonValidators::PositiveFloat, "Changes how far camera can see the Macro map rendering on the material" ); diff --git a/Engine/source/terrain/terrMaterial.h b/Engine/source/terrain/terrMaterial.h index c119f57b1..19c712128 100644 --- a/Engine/source/terrain/terrMaterial.h +++ b/Engine/source/terrain/terrMaterial.h @@ -38,17 +38,17 @@ class TerrainMaterial : public SimObject protected: /// - DECLARE_IMAGEASSET_REFACTOR(TerrainMaterial, DiffuseMap, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET(TerrainMaterial, DiffuseMap, GFXStaticTextureSRGBProfile) /// The size of the diffuse base map in meters /// used to generate its texture coordinates. F32 mDiffuseSize; /// - DECLARE_IMAGEASSET_REFACTOR(TerrainMaterial, NormalMap, GFXNormalMapProfile) + DECLARE_IMAGEASSET(TerrainMaterial, NormalMap, GFXNormalMapProfile) /// - DECLARE_IMAGEASSET_REFACTOR(TerrainMaterial, DetailMap, GFXStaticTextureProfile) + DECLARE_IMAGEASSET(TerrainMaterial, DetailMap, GFXStaticTextureProfile) /// The size of the detail map in meters used /// to generate the texture coordinates for the @@ -62,7 +62,7 @@ protected: F32 mDetailDistance; /// - DECLARE_IMAGEASSET_REFACTOR(TerrainMaterial, ORMConfigMap, GFXStaticTextureProfile) + DECLARE_IMAGEASSET(TerrainMaterial, ORMConfigMap, GFXStaticTextureProfile) bool mIsSRGB; bool mInvertRoughness; @@ -73,7 +73,7 @@ protected: /// planes. bool mSideProjection; - DECLARE_IMAGEASSET_REFACTOR(TerrainMaterial, MacroMap, GFXStaticTextureProfile) + DECLARE_IMAGEASSET(TerrainMaterial, MacroMap, GFXStaticTextureProfile) F32 mMacroSize; F32 mMacroStrength;