initial commit

change the macro to use the refactor (exact same structure as the imageasset macro)
This commit is contained in:
marauder2k7 2025-06-19 13:34:07 +01:00
parent 61a75ada1e
commit ca1604170d
29 changed files with 700 additions and 457 deletions

View file

@ -140,7 +140,8 @@ class ShapeBaseConvex : public Convex
//--------------------------------------------------------------------------
struct ShapeBaseImageData: public GameBaseData {
struct ShapeBaseImageData: public GameBaseData, protected AssetPtrCallback
{
private:
typedef GameBaseData Parent;
@ -380,11 +381,7 @@ struct ShapeBaseImageData: public GameBaseData {
F32 scriptAnimTransitionTime; ///< The amount of time to transition between the previous sequence and new sequence
///< when the script prefix has changed.
DECLARE_SHAPEASSET_ARRAY(ShapeBaseImageData, Shape, MaxShapes, onShapeChanged); ///< Name of shape to render.
DECLARE_ASSET_ARRAY_SETGET(ShapeBaseImageData, Shape);
//DECLARE_SHAPEASSET(ShapeBaseImageData, ShapeFP); ///< Name of shape to render in first person (optional).
//DECLARE_ASSET_SETGET(ShapeBaseImageData, ShapeFP);
DECLARE_SHAPEASSET_ARRAY_REFACTOR(ShapeBaseImageData, Shape, MaxShapes) ///< Name of shape to render.
StringTableEntry imageAnimPrefix; ///< Passed along to the mounting shape to modify
/// animation sequences played in 3rd person. [optional]
@ -519,6 +516,12 @@ struct ShapeBaseImageData: public GameBaseData {
DECLARE_CALLBACK( void, onMount, ( SceneObject* obj, S32 slot, F32 dt ) );
DECLARE_CALLBACK( void, onUnmount, ( SceneObject* obj, S32 slot, F32 dt ) );
/// @}
protected:
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
{
reloadOnLocalClient();
}
};
typedef ShapeBaseImageData::LightType ShapeBaseImageLightType;
@ -533,7 +536,7 @@ DefineEnumType( ShapeBaseImageRecoilState );
//--------------------------------------------------------------------------
/// @nosubgrouping
struct ShapeBaseData : public GameBaseData {
struct ShapeBaseData : public GameBaseData, protected AssetPtrCallback {
private:
typedef GameBaseData Parent;
@ -553,8 +556,7 @@ public:
F32 shadowProjectionDistance;
F32 shadowSphereAdjust;
DECLARE_SHAPEASSET(ShapeBaseData, Shape, onShapeChanged);
DECLARE_ASSET_SETGET(ShapeBaseData, Shape);
DECLARE_SHAPEASSET_REFACTOR(ShapeBaseData, Shape)
StringTableEntry cloakTexName;
@ -570,8 +572,7 @@ public:
DebrisData * debris;
S32 debrisID;
DECLARE_SHAPEASSET(ShapeBaseData, DebrisShape, onDebrisChanged);
DECLARE_ASSET_SETGET(ShapeBaseData, DebrisShape);
DECLARE_SHAPEASSET_REFACTOR(ShapeBaseData, DebrisShape)
ExplosionData* explosion;
S32 explosionID;
@ -691,10 +692,14 @@ public:
Vector<TextureTagRemapping> txr_tag_remappings;
bool silent_bbox_check;
void onShapeChanged();
void onDebrisChanged();
public:
ShapeBaseData(const ShapeBaseData&, bool = false);
protected:
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
{
reloadOnLocalClient();
}
};