Cleans up ShapeAsset of some unnecessary/redundant elements like extra material and animations tracking

Removed the old SHAPE_ASSET macros
Implements AssetRef struct that acts as a universal wrapper for an templated AssetPtr and AssetId pair
Adds Type handling for AssetRef for ShapeAsset to unify handling in classes that utilize a shapeAsset, so assigning an assetPtr or an assetId will keep a record of the assignment in the event the assetPtr is invalid.
Update all classes that utilized the old SHAPE_ASSET macros to utilize the AssetRef struct and updated the class code to utilize it to provide much more clean and concise code that isn't blocked behind macro definitions
Added a new example class: shapeDatablockExample which allows render of a simple shape object utilizing a simple example datablock.
This commit is contained in:
JeffR 2026-05-31 01:19:26 -05:00
parent c2c5674fe9
commit b44158cb89
52 changed files with 1860 additions and 1086 deletions

View file

@ -381,7 +381,7 @@ struct ShapeBaseImageData: public GameBaseData, protected AssetPtrCallback
F32 scriptAnimTransitionTime; ///< The amount of time to transition between the previous sequence and new sequence
///< when the script prefix has changed.
DECLARE_SHAPEASSET_ARRAY_REFACTOR(ShapeBaseImageData, Shape, MaxShapes) ///< Name of shape to render.
AssetRef<ShapeAsset> shapeAssetRef[MaxShapes];
StringTableEntry imageAnimPrefix; ///< Passed along to the mounting shape to modify
/// animation sequences played in 3rd person. [optional]
@ -556,7 +556,7 @@ public:
F32 shadowProjectionDistance;
F32 shadowSphereAdjust;
DECLARE_SHAPEASSET_REFACTOR(ShapeBaseData, Shape)
AssetRef<ShapeAsset> shapeAssetRef;
StringTableEntry cloakTexName;
@ -572,7 +572,7 @@ public:
DebrisData * debris;
S32 debrisID;
DECLARE_SHAPEASSET_REFACTOR(ShapeBaseData, DebrisShape)
AssetRef<ShapeAsset> debrisShapeAssetRef;
ExplosionData* explosion;
S32 explosionID;