From 254893b8d235d74040ac1bda98d598a11e49c206 Mon Sep 17 00:00:00 2001 From: jonwd7 <jon.wd7@gmail.com> Date: Wed, 2 Aug 2017 12:35:05 -0400 Subject: [PATCH] Relaxed suffix enforcement for niflib Duplicate name avoidance was too strict and unnecessary in these cases. Nifdocsys will now attempt to cast subsequent duplicate names to the correct types in order to ensure correct read/write size. As such the first type should always be the largest, so the "Flags" fields on NiAVObject were switched. So in the case of Flags and Body Flags, a uint data member will be created on the class and will be read/written to with a cast during I/O. The suffix is still required when the types are not castable between one another. --- nif.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nif.xml b/nif.xml index 8227463..9767a1a 100644 --- a/nif.xml +++ b/nif.xml @@ -2265,8 +2265,8 @@ <add name="Unknown Bytes 2" type="byte" arr1="4" vercond="(User Version 2 > 34)">Unknown. Skyrim only.</add> <add name="Num Constraints" type="uint"> The number of constraints this object is bound to.</add> <add name="Constraints" type="Ref" template="bhkSerializable" arr1="Num Constraints">Unknown.</add> - <add name="Body Flags" suffix="Old" type="uint" vercond="(User Version 2 < 76)">1 = respond to wind</add> - <add name="Body Flags" suffix="New" type="ushort" vercond="(User Version 2 >= 76)">1 = respond to wind</add> + <add name="Body Flags" type="uint" vercond="(User Version 2 < 76)">1 = respond to wind</add> + <add name="Body Flags" type="ushort" vercond="(User Version 2 >= 76)">1 = respond to wind</add> </niobject> <niobject name="bhkRigidBodyT" abstract="0" inherit="bhkRigidBody"> @@ -2667,8 +2667,8 @@ <niobject name="NiAVObject" abstract="1" inherit="NiObjectNET"> Base audiovisual object. + <add name="Flags" type="uint" default="14" vercond="(Version == 20.2.0.7) && (User Version >= 11) && (User Version 2 > 26)">Basic flags for AV objects.</add> <add name="Flags" type="Flags" ver1="3.0" vercond="!((Version == 20.2.0.7) && (User Version >= 11) && (User Version 2 > 26))">Basic flags for AV objects; commonly 0x000C or 0x000A.</add> - <add name="Flags" suffix="BS" type="uint" default="14" vercond="(Version == 20.2.0.7) && (User Version >= 11) && (User Version 2 > 26)">Basic flags for AV objects.</add> <!-- TODO use MTransform --> <add name="Translation" type="Vector3">The translation vector.</add> <add name="Rotation" type="Matrix33">The rotation part of the transformation matrix.</add> @@ -2951,10 +2951,10 @@ <niobject name="NiGeometry" abstract="1" inherit="NiAVObject"> Describes a visible scene element with vertices like a mesh, a particle system, lines, etc. <add name="Data" type="Ref" template="NiGeometryData" vercond="!((Version == 20.2.0.7) && (User Version 2 >= 100))">Data index (NiTriShapeData/NiTriStripData).</add> - <add name="Data" suffix="BS" type="Ref" template="NiGeometryData" vercond="(Version == 20.2.0.7) && (User Version 2 >= 100)" cond="!NiParticleSystem">Data index (NiTriShapeData/NiTriStripData).</add> + <add name="Data" type="Ref" template="NiGeometryData" vercond="(Version == 20.2.0.7) && (User Version 2 >= 100)" cond="!NiParticleSystem">Data index (NiTriShapeData/NiTriStripData).</add> <add name="Data" suffix="BSPS" type="uint" vercond="(Version == 20.2.0.7) && (User Version 2 >= 100)" cond="NiParticleSystem">Data index (NiTriShapeData/NiTriStripData).</add> <add name="Skin Instance" type="Ref" template="NiSkinInstance" vercond="(Version >= 3.3.0.13) && !((Version == 20.2.0.7) && (User Version 2 >= 100))">Skin instance index.</add> - <add name="Skin Instance" suffix="BS" type="Ref" template="NiSkinInstance" vercond="(Version == 20.2.0.7) && (User Version 2 >= 100)" cond="!NiParticleSystem">Skin instance index.</add> + <add name="Skin Instance" type="Ref" template="NiSkinInstance" vercond="(Version == 20.2.0.7) && (User Version 2 >= 100)" cond="!NiParticleSystem">Skin instance index.</add> <add name="Skin Instance" suffix="BSPS" type="uint" vercond="(Version == 20.2.0.7) && (User Version 2 >= 100)" cond="NiParticleSystem">Skin instance index.</add> <add name="Num Materials" type="uint" ver1="20.2.0.7">Num Materials</add> <add name="Material Name" type="string" arr1="Num Materials" ver1="20.2.0.7">Unknown string. Shader?</add> -- GitLab