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.
This commit is contained in:
marauder2k7 2025-03-30 11:22:42 +01:00
parent b707b2e2b7
commit 73ad92b757
60 changed files with 189 additions and 164 deletions

View file

@ -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.");

View file

@ -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;

View file

@ -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." );

View file

@ -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;

View file

@ -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 );

View file

@ -98,7 +98,7 @@ protected:
public:
DECLARE_IMAGEASSET_NET_REFACTOR(CloudLayer,Texture, GFXStaticTextureSRGBProfile, CloudLayerMask)
DECLARE_IMAGEASSET_NET(CloudLayer,Texture, GFXStaticTextureSRGBProfile, CloudLayerMask)
GFXShaderRef mShader;

View file

@ -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." );

View file

@ -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;