diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index f70b9024f9..1a1bbd7217 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -153,6 +153,9 @@ static std::map makeFactory() factory["bhkRigidBody"] = {&construct , RC_bhkRigidBody }; factory["bhkRigidBodyT"] = {&construct , RC_bhkRigidBodyT }; factory["BSLightingShaderProperty"] = {&construct , RC_BSLightingShaderProperty }; + factory["NiSortAdjustNode"] = {&construct , RC_NiNode }; + factory["NiClusterAccumulator"] = {&construct , RC_NiClusterAccumulator }; + factory["NiAlphaAccumulator"] = {&construct , RC_NiAlphaAccumulator }; return factory; } diff --git a/components/nif/node.hpp b/components/nif/node.hpp index c01ba9b663..7e5bcdb3be 100644 --- a/components/nif/node.hpp +++ b/components/nif/node.hpp @@ -427,5 +427,39 @@ struct NiLODNode : public NiSwitchNode } }; +// Abstract +struct NiAccumulator : Record +{ + void read(NIFStream *nif) override {} +}; + +// Node children sorters +struct NiClusterAccumulator : NiAccumulator {}; +struct NiAlphaAccumulator : NiClusterAccumulator {}; + +struct NiSortAdjustNode : NiNode +{ + enum SortingMode + { + SortingMode_Inherit, + SortingMode_Off, + SortingMode_Subsort + }; + + int mMode; + NiAccumulatorPtr mSubSorter; + void read(NIFStream *nif) override + { + NiNode::read(nif); + mMode = nif->getInt(); + if (nif->getVersion() <= NIFStream::generateVersion(20,0,0,3)) + mSubSorter.read(nif); + } + void post(NIFFile *nif) override + { + mSubSorter.post(nif); + } +}; + } // Namespace #endif diff --git a/components/nif/record.hpp b/components/nif/record.hpp index b38186bd04..937ce1d1e9 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -140,7 +140,9 @@ enum RecordType RC_bhkListShape, RC_bhkRigidBody, RC_bhkRigidBodyT, - RC_BSLightingShaderProperty + RC_BSLightingShaderProperty, + RC_NiClusterAccumulator, + RC_NiAlphaAccumulator }; /// Base class for all records diff --git a/components/nif/recordptr.hpp b/components/nif/recordptr.hpp index cc62d7b2e0..5ec00b0c92 100644 --- a/components/nif/recordptr.hpp +++ b/components/nif/recordptr.hpp @@ -153,6 +153,7 @@ struct bhkWorldObject; struct bhkShape; struct bhkSerializable; struct hkPackedNiTriStripsData; +struct NiAccumulator; using NodePtr = RecordPtrT; using ExtraPtr = RecordPtrT; @@ -184,6 +185,7 @@ using NiCollisionObjectPtr = RecordPtrT; using bhkWorldObjectPtr = RecordPtrT; using bhkShapePtr = RecordPtrT; using hkPackedNiTriStripsDataPtr = RecordPtrT; +using NiAccumulatorPtr = RecordPtrT; using NodeList = RecordListT; using PropertyList = RecordListT;