Updates ImageAsset usage to utilize AssetRef, and standardizes the setter/getter functions and naming conventions, as well as the ability to use and bind named targets.

This commit is contained in:
JeffR 2026-06-16 17:39:30 -05:00
parent a858d8624e
commit 34e3f78a22
82 changed files with 1451 additions and 951 deletions

View file

@ -93,7 +93,9 @@ AccumulationVolume::~AccumulationVolume()
void AccumulationVolume::initPersistFields()
{
docsURL;
INITPERSISTFIELD_IMAGEASSET(Texture, AccumulationVolume, "Accumulation texture.")
ADD_FIELD("textureAsset", TypeImageAssetRef, Offset(mTextureAssetRef, AccumulationVolume))
.network(U32(-1))
.doc("Accumulation texture asset");
Parent::initPersistFields();
}
@ -229,7 +231,7 @@ U32 AccumulationVolume::packUpdate( NetConnection *connection, U32 mask, BitStre
if (stream->writeFlag(mask & InitialUpdateMask))
{
PACK_ASSET_REFACTOR(connection, Texture);
AssetDatabase.packUpdateAsset(connection, mask, stream, mTextureAssetRef.assetId);
}
return retMask;
@ -241,7 +243,7 @@ void AccumulationVolume::unpackUpdate( NetConnection *connection, BitStream *str
if (stream->readFlag())
{
UNPACK_ASSET_REFACTOR(connection, Texture);
mTextureAssetRef = AssetDatabase.unpackUpdateAsset(connection, stream);
//setTexture(mTextureName);
}
}
@ -256,7 +258,8 @@ void AccumulationVolume::inspectPostApply()
void AccumulationVolume::setTexture( const String& name )
{
_setTexture(StringTable->insert(name.c_str()));
mTextureAssetRef = StringTable->insert(name.c_str());
setMaskBits(-1);
refreshVolumes();
}