all DECLARE_IMAGEASSET refactored

This commit is contained in:
marauder2k7 2024-12-21 17:34:16 +00:00
parent 24b374f545
commit fa8110ce8f
44 changed files with 248 additions and 306 deletions

View file

@ -51,7 +51,6 @@ ConsoleDocClass( afxBillboardData,
afxBillboardData::afxBillboardData()
{
color.set(1.0f, 1.0f, 1.0f, 1.0f);
INIT_ASSET(Texture);
dimensions.set(1.0f, 1.0f);
texCoords[0].set(0.0f, 0.0f);
texCoords[1].set(0.0f, 1.0f);
@ -66,7 +65,7 @@ afxBillboardData::afxBillboardData(const afxBillboardData& other, bool temp_clon
: GameBaseData(other, temp_clone)
{
color = other.color;
CLONE_ASSET(Texture);
CLONE_ASSET_REFACTOR(Texture);
dimensions = other.dimensions;
texCoords[0] = other.texCoords[0];
texCoords[1] = other.texCoords[1];
@ -96,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(Texture, afxBillboardData, "An image to use as the billboard's texture.");
INITPERSISTFIELD_IMAGEASSET_REFACTOR(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 "
@ -124,7 +123,7 @@ void afxBillboardData::packData(BitStream* stream)
Parent::packData(stream);
stream->write(color);
PACKDATA_ASSET(Texture);
PACKDATA_ASSET_REFACTOR(Texture);
mathWrite(*stream, dimensions);
mathWrite(*stream, texCoords[0]);
@ -141,7 +140,7 @@ void afxBillboardData::unpackData(BitStream* stream)
Parent::unpackData(stream);
stream->read(&color);
UNPACKDATA_ASSET(Texture);
UNPACKDATA_ASSET_REFACTOR(Texture);
mathRead(*stream, &dimensions);
mathRead(*stream, &texCoords[0]);
mathRead(*stream, &texCoords[1]);