Merge branch 'assorted' into 'master'

Load NiSortAdjustNode and NiAccumulators

See merge request OpenMW/openmw!1396
switch-to-ppa
psi29a 3 years ago
commit 6c7dc2d72f

@ -153,6 +153,9 @@ static std::map<std::string,RecordFactoryEntry> makeFactory()
factory["bhkRigidBody"] = {&construct <bhkRigidBody> , RC_bhkRigidBody };
factory["bhkRigidBodyT"] = {&construct <bhkRigidBody> , RC_bhkRigidBodyT };
factory["BSLightingShaderProperty"] = {&construct <BSLightingShaderProperty> , RC_BSLightingShaderProperty };
factory["NiSortAdjustNode"] = {&construct <NiSortAdjustNode> , RC_NiNode };
factory["NiClusterAccumulator"] = {&construct <NiClusterAccumulator> , RC_NiClusterAccumulator };
factory["NiAlphaAccumulator"] = {&construct <NiAlphaAccumulator> , RC_NiAlphaAccumulator };
return factory;
}

@ -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

@ -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

@ -153,6 +153,7 @@ struct bhkWorldObject;
struct bhkShape;
struct bhkSerializable;
struct hkPackedNiTriStripsData;
struct NiAccumulator;
using NodePtr = RecordPtrT<Node>;
using ExtraPtr = RecordPtrT<Extra>;
@ -184,6 +185,7 @@ using NiCollisionObjectPtr = RecordPtrT<NiCollisionObject>;
using bhkWorldObjectPtr = RecordPtrT<bhkWorldObject>;
using bhkShapePtr = RecordPtrT<bhkShape>;
using hkPackedNiTriStripsDataPtr = RecordPtrT<hkPackedNiTriStripsData>;
using NiAccumulatorPtr = RecordPtrT<NiAccumulator>;
using NodeList = RecordListT<Node>;
using PropertyList = RecordListT<Property>;

Loading…
Cancel
Save