Plasma Engine  2.0
Loading...
Searching...
No Matches
plGraphPatch Class Referenceabstract

Patch base class for plAbstractObjectGraph patches. More...

#include <GraphPatch.h>

Inherits plEnumerable< plGraphPatch >.

Inherited by plAlphaControlPoint_1_2, plAmbientLightComponentPatch_1_2, plBlackboardComponent_2_3, plCameraComponentPatch_4_5, plCameraComponentPatch_8_9, plColorControlPoint_1_2, plColorGradientAssetDataPatch_1_2, plCurve1DAssetData_1_2, plCurve1DControlPointPatch_1_2, plCurve1DControlPoint_2_3, plCurve1DControlPoint_3_4, plCurve1DControlPoint_4_5, plCurve1DDataPatch_1_2, plCurve1DData_2_3, plDecalComponent_6_7, plDirectionalLightComponentPatch_1_2, plFakeRopeComponentPatch_2_3, plForwardRenderPassPatch_1_2, plInputComponentPatch_1_2, plIntensityControlPoint_1_2, plJoltHitboxComponentPatch_1_2, plJoltRopeComponentPatch_1_2, plLightComponentPatch_1_2, plMaterialAssetPropertiesPatch_1_2, plMaterialAssetPropertiesPatch_2_3, plMeshAssetPropertiesPatch_1_2, plMeshAssetPropertiesPatch_2_3, plMsaaUpscalePassPatch_1_2, plParticleInitializerFactory_CylinderPosition_1_2, plParticleInitializerFactory_RandomRotationSpeed_1_2, plParticleInitializerFactory_RandomSize_1_2, plParticleInitializerFactory_SpherePosition_1_2, plParticleInitializerFactory_VelocityCone_1_2, plParticleSystemDescriptor_1_2, plParticleTypeQuadFactory_1_2, plPointLightComponentPatch_1_2, plProcGen_Blend_1_2, plProcVolumeBoxComponent_1_2, plProcVolumeSphereComponent_1_2, plProjectileComponentPatch_1_2, plProjectileComponentPatch_5_6, plQuadParticleOrientationPatch_1_2, plReflectedPropertyDescriptorPatch_1_2, plRotorComponentPatch_1_2, plSeparatedBilateralBlurPassPatch_1_2, plShaderBaseTypePatch_1_2, plShaderTypePatch_1_2, plSkyBoxComponentPatch_1_2, plSkyLightComponentPatch_2_3, plSliderComponentPatch_1_2, plSourcePassPatch_1_2, plSourcePassPatch_2_3, plSpawnComponentPatch_1_2, plSphereReflectionProbeComponent_1_2, plSpotLightComponentPatch_1_2, plSpriteComponentPatch_1_2, plSurfaceResourceDescriptorPatch_1_2, plTextureAssetPropertiesPatch_2_3, plTextureAssetPropertiesPatch_3_4, plTextureAssetPropertiesPatch_4_5, plTextureCubeAssetProperties_2_3, plTimedDeathComponentPatch_1_2, plTransformComponentPatch_1_2, plTransformComponentPatch_2_3, plVRConfig_1_2, and plWindVolumeComponentPatch_2_3.

Public Types

enum class  PatchType : plUInt8 { NodePatch , GraphPatch }
 

Public Member Functions

 plGraphPatch (const char *szType, plUInt32 uiTypeVersion, PatchType type=PatchType::NodePatch)
 Constructor. pType is the type to patch. uiTypeVersion is the version to patch to.
 
virtual void Patch (plGraphPatchContext &ref_context, plAbstractObjectGraph *pGraph, plAbstractObjectNode *pNode) const =0
 Patch function. If type == PatchType::NodePatch, the implementation needs to patch pNode in pGraph to m_uiTypeVersion. If type == PatchType::GraphPatch, pNode will be nullptr and the implementation has to figure out what to patch in pGraph on its own.
 
const char * GetType () const
 Returns the type to patch.
 
plUInt32 GetTypeVersion () const
 Returns the type version to patch to.
 
PatchType GetPatchType () const
 
 PL_DECLARE_ENUMERABLE_CLASS (plGraphPatch)
 

Additional Inherited Members

- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 
- Protected Attributes inherited from plEnumerable< plGraphPatch >
plEnumerablem_pNextInstance
 

Detailed Description

Patch base class for plAbstractObjectGraph patches.

Create static instance of derived class to automatically patch graphs on load.

Member Enumeration Documentation

◆ PatchType

enum class plGraphPatch::PatchType : plUInt8
strong
Enumerator
NodePatch 

Patch applies to a node of a certain type and version.

GraphPatch 

Patch applies to an entire graph without any restrictions.

Constructor & Destructor Documentation

◆ plGraphPatch()

plGraphPatch::plGraphPatch ( const char * szType,
plUInt32 uiTypeVersion,
PatchType type = PatchType::NodePatch )

Constructor. pType is the type to patch. uiTypeVersion is the version to patch to.

Patches are executed in order from version uiTypeVersion-1 to uiTypeVersion. If no patch exists for previous versions the input to the patch function can potentially be of a lower version than uiTypeVersion-1. If type is PatchType::NodePatch, the patch is executed for each instance of the given type. If type is PatchType::GraphPatch, the patch is executed once for the entire graph. In this case szType and uiTypeVersion are ignored and the patch function has to figure out what to do by itself.


The documentation for this class was generated from the following files: