1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-21 21:03:07 +00:00

Make NIF base record members conform to the naming conventions

This commit is contained in:
Alexei Kotov 2025-12-16 13:22:47 +03:00
parent 1e5979b80f
commit a0b73d5e62
13 changed files with 172 additions and 163 deletions

View file

@ -40,13 +40,13 @@ namespace Nif::Testing
inline void init(NiTriShape& value) inline void init(NiTriShape& value)
{ {
init(static_cast<NiGeometry&>(value)); init(static_cast<NiGeometry&>(value));
value.recType = RC_NiTriShape; value.mRecordType = RC_NiTriShape;
} }
inline void init(NiTriStrips& value) inline void init(NiTriStrips& value)
{ {
init(static_cast<NiGeometry&>(value)); init(static_cast<NiGeometry&>(value));
value.recType = RC_NiTriStrips; value.mRecordType = RC_NiTriStrips;
} }
inline void init(NiSkinInstance& value) inline void init(NiSkinInstance& value)

View file

@ -159,9 +159,9 @@ namespace Nif
{ {
const Record* const record = reader.getRecord(0); const Record* const record = reader.getRecord(0);
ASSERT_NE(record, nullptr); ASSERT_NE(record, nullptr);
EXPECT_EQ(record->recIndex, 0); EXPECT_EQ(record->mRecordIndex, 0);
EXPECT_EQ(record->recName, "bhkRagdollTemplate"); EXPECT_EQ(record->mRecordName, "bhkRagdollTemplate");
EXPECT_EQ(record->recType, RC_bhkRagdollTemplate); EXPECT_EQ(record->mRecordType, RC_bhkRagdollTemplate);
const bhkRagdollTemplate* const typed = dynamic_cast<const bhkRagdollTemplate*>(record); const bhkRagdollTemplate* const typed = dynamic_cast<const bhkRagdollTemplate*>(record);
ASSERT_NE(typed, nullptr); ASSERT_NE(typed, nullptr);
@ -173,9 +173,9 @@ namespace Nif
{ {
const Record* const record = reader.getRecord(1); const Record* const record = reader.getRecord(1);
ASSERT_NE(record, nullptr); ASSERT_NE(record, nullptr);
EXPECT_EQ(record->recIndex, 1); EXPECT_EQ(record->mRecordIndex, 1);
EXPECT_EQ(record->recName, "bhkRagdollTemplateData"); EXPECT_EQ(record->mRecordName, "bhkRagdollTemplateData");
EXPECT_EQ(record->recType, RC_bhkRagdollTemplateData); EXPECT_EQ(record->mRecordType, RC_bhkRagdollTemplateData);
const bhkRagdollTemplateData* const typed = dynamic_cast<const bhkRagdollTemplateData*>(record); const bhkRagdollTemplateData* const typed = dynamic_cast<const bhkRagdollTemplateData*>(record);
ASSERT_NE(typed, nullptr); ASSERT_NE(typed, nullptr);

View file

@ -347,19 +347,19 @@ namespace
init(mNiStringExtraData2); init(mNiStringExtraData2);
init(mController); init(mController);
mNiTriShapeData.recType = Nif::RC_NiTriShapeData; mNiTriShapeData.mRecordType = Nif::RC_NiTriShapeData;
mNiTriShapeData.mVertices = { osg::Vec3f(0, 0, 0), osg::Vec3f(1, 0, 0), osg::Vec3f(1, 1, 0) }; mNiTriShapeData.mVertices = { osg::Vec3f(0, 0, 0), osg::Vec3f(1, 0, 0), osg::Vec3f(1, 1, 0) };
mNiTriShapeData.mNumTriangles = 1; mNiTriShapeData.mNumTriangles = 1;
mNiTriShapeData.mTriangles = { 0, 1, 2 }; mNiTriShapeData.mTriangles = { 0, 1, 2 };
mNiTriShape.mData = Nif::NiGeometryDataPtr(&mNiTriShapeData); mNiTriShape.mData = Nif::NiGeometryDataPtr(&mNiTriShapeData);
mNiTriShapeData2.recType = Nif::RC_NiTriShapeData; mNiTriShapeData2.mRecordType = Nif::RC_NiTriShapeData;
mNiTriShapeData2.mVertices = { osg::Vec3f(0, 0, 1), osg::Vec3f(1, 0, 1), osg::Vec3f(1, 1, 1) }; mNiTriShapeData2.mVertices = { osg::Vec3f(0, 0, 1), osg::Vec3f(1, 0, 1), osg::Vec3f(1, 1, 1) };
mNiTriShapeData2.mNumTriangles = 1; mNiTriShapeData2.mNumTriangles = 1;
mNiTriShapeData2.mTriangles = { 0, 1, 2 }; mNiTriShapeData2.mTriangles = { 0, 1, 2 };
mNiTriShape2.mData = Nif::NiGeometryDataPtr(&mNiTriShapeData2); mNiTriShape2.mData = Nif::NiGeometryDataPtr(&mNiTriShapeData2);
mNiTriStripsData.recType = Nif::RC_NiTriStripsData; mNiTriStripsData.mRecordType = Nif::RC_NiTriStripsData;
mNiTriStripsData.mVertices mNiTriStripsData.mVertices
= { osg::Vec3f(0, 0, 0), osg::Vec3f(1, 0, 0), osg::Vec3f(1, 1, 0), osg::Vec3f(0, 1, 0) }; = { osg::Vec3f(0, 0, 0), osg::Vec3f(1, 0, 0), osg::Vec3f(1, 1, 0), osg::Vec3f(0, 1, 0) };
mNiTriStripsData.mNumTriangles = 2; mNiTriStripsData.mNumTriangles = 2;
@ -410,7 +410,7 @@ namespace
TEST_F(TestBulletNifLoader, for_default_root_collision_node_nif_node_should_return_default) TEST_F(TestBulletNifLoader, for_default_root_collision_node_nif_node_should_return_default)
{ {
mNode.recType = Nif::RC_RootCollisionNode; mNode.mRecordType = Nif::RC_RootCollisionNode;
Nif::NIFFile file(testNif); Nif::NIFFile file(testNif);
file.mRoots.push_back(&mNode); file.mRoots.push_back(&mNode);
@ -831,7 +831,7 @@ namespace
TEST_F(TestBulletNifLoader, for_tri_shape_child_node_with_controller_should_return_animated_shape) TEST_F(TestBulletNifLoader, for_tri_shape_child_node_with_controller_should_return_animated_shape)
{ {
mController.recType = Nif::RC_NiKeyframeController; mController.mRecordType = Nif::RC_NiKeyframeController;
mController.mFlags |= Nif::NiTimeController::Flag_Active; mController.mFlags |= Nif::NiTimeController::Flag_Active;
copy(mTransform, mNiTriShape.mTransform); copy(mTransform, mNiTriShape.mTransform);
mNiTriShape.mTransform.mScale = 3; mNiTriShape.mTransform.mScale = 3;
@ -861,7 +861,7 @@ namespace
TEST_F(TestBulletNifLoader, for_two_tri_shape_children_nodes_where_one_with_controller_should_return_animated_shape) TEST_F(TestBulletNifLoader, for_two_tri_shape_children_nodes_where_one_with_controller_should_return_animated_shape)
{ {
mController.recType = Nif::RC_NiKeyframeController; mController.mRecordType = Nif::RC_NiKeyframeController;
mController.mFlags |= Nif::NiTimeController::Flag_Active; mController.mFlags |= Nif::NiTimeController::Flag_Active;
copy(mTransform, mNiTriShape.mTransform); copy(mTransform, mNiTriShape.mTransform);
mNiTriShape.mTransform.mScale = 3; mNiTriShape.mTransform.mScale = 3;
@ -940,7 +940,7 @@ namespace
{ {
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
mNiNode.recType = Nif::RC_AvoidNode; mNiNode.mRecordType = Nif::RC_AvoidNode;
Nif::NIFFile file(testNif); Nif::NIFFile file(testNif);
file.mRoots.push_back(&mNiNode); file.mRoots.push_back(&mNiNode);
@ -1001,7 +1001,7 @@ namespace
for_root_node_with_extra_data_string_equal_ncc_should_return_shape_with_cameraonly_collision) for_root_node_with_extra_data_string_equal_ncc_should_return_shape_with_cameraonly_collision)
{ {
mNiStringExtraData.mData = "NCC__"; mNiStringExtraData.mData = "NCC__";
mNiStringExtraData.recType = Nif::RC_NiStringExtraData; mNiStringExtraData.mRecordType = Nif::RC_NiStringExtraData;
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData); mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1032,7 +1032,7 @@ namespace
{ {
mNiStringExtraData.mNext = Nif::ExtraPtr(&mNiStringExtraData2); mNiStringExtraData.mNext = Nif::ExtraPtr(&mNiStringExtraData2);
mNiStringExtraData2.mData = "NCC__"; mNiStringExtraData2.mData = "NCC__";
mNiStringExtraData2.recType = Nif::RC_NiStringExtraData; mNiStringExtraData2.mRecordType = Nif::RC_NiStringExtraData;
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData); mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1061,7 +1061,7 @@ namespace
TestBulletNifLoader, for_root_node_with_extra_data_string_starting_with_nc_should_return_shape_with_nocollision) TestBulletNifLoader, for_root_node_with_extra_data_string_starting_with_nc_should_return_shape_with_nocollision)
{ {
mNiStringExtraData.mData = "NC___"; mNiStringExtraData.mData = "NC___";
mNiStringExtraData.recType = Nif::RC_NiStringExtraData; mNiStringExtraData.mRecordType = Nif::RC_NiStringExtraData;
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData); mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1091,7 +1091,7 @@ namespace
{ {
mNiStringExtraData.mNext = Nif::ExtraPtr(&mNiStringExtraData2); mNiStringExtraData.mNext = Nif::ExtraPtr(&mNiStringExtraData2);
mNiStringExtraData2.mData = "NC___"; mNiStringExtraData2.mData = "NC___";
mNiStringExtraData2.recType = Nif::RC_NiStringExtraData; mNiStringExtraData2.mRecordType = Nif::RC_NiStringExtraData;
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData); mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1119,7 +1119,7 @@ namespace
TEST_F(TestBulletNifLoader, for_tri_shape_child_node_with_extra_data_string_should_ignore_extra_data) TEST_F(TestBulletNifLoader, for_tri_shape_child_node_with_extra_data_string_should_ignore_extra_data)
{ {
mNiStringExtraData.mData = "NC___"; mNiStringExtraData.mData = "NC___";
mNiStringExtraData.recType = Nif::RC_NiStringExtraData; mNiStringExtraData.mRecordType = Nif::RC_NiStringExtraData;
mNiTriShape.mExtra = Nif::ExtraPtr(&mNiStringExtraData); mNiTriShape.mExtra = Nif::ExtraPtr(&mNiStringExtraData);
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1153,7 +1153,7 @@ namespace
niTriShape.mData = Nif::NiGeometryDataPtr(&mNiTriShapeData); niTriShape.mData = Nif::NiGeometryDataPtr(&mNiTriShapeData);
niTriShape.mParents.push_back(&mNiNode); niTriShape.mParents.push_back(&mNiNode);
emptyCollisionNode.recType = Nif::RC_RootCollisionNode; emptyCollisionNode.mRecordType = Nif::RC_RootCollisionNode;
emptyCollisionNode.mParents.push_back(&mNiNode); emptyCollisionNode.mParents.push_back(&mNiNode);
mNiNode.mChildren mNiNode.mChildren
@ -1184,7 +1184,7 @@ namespace
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiTriShape.mName = "EditorMarker"; mNiTriShape.mName = "EditorMarker";
mNiIntegerExtraData.mData = 34; // BSXFlags "has collision" | "editor marker" mNiIntegerExtraData.mData = 34; // BSXFlags "has collision" | "editor marker"
mNiIntegerExtraData.recType = Nif::RC_BSXFlags; mNiIntegerExtraData.mRecordType = Nif::RC_BSXFlags;
mNiNode.mExtraList.push_back(Nif::ExtraPtr(&mNiIntegerExtraData)); mNiNode.mExtraList.push_back(Nif::ExtraPtr(&mNiIntegerExtraData));
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1205,7 +1205,7 @@ namespace
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiTriShape.mName = "Tri EditorMarker"; mNiTriShape.mName = "Tri EditorMarker";
mNiStringExtraData.mData = "MRK"; mNiStringExtraData.mData = "MRK";
mNiStringExtraData.recType = Nif::RC_NiStringExtraData; mNiStringExtraData.mRecordType = Nif::RC_NiStringExtraData;
mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData); mNiNode.mExtra = Nif::ExtraPtr(&mNiStringExtraData);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
@ -1276,7 +1276,7 @@ namespace
{ {
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
mNiNode.recType = Nif::RC_AvoidNode; mNiNode.mRecordType = Nif::RC_AvoidNode;
mNiTriStripsData.mStrips.front() = { 0, 1 }; mNiTriStripsData.mStrips.front() = { 0, 1 };
Nif::NIFFile file(testNif); Nif::NIFFile file(testNif);

View file

@ -257,7 +257,7 @@ osg::Group {
Nif::NiAVObject node; Nif::NiAVObject node;
init(node); init(node);
Nif::BSShaderPPLightingProperty property; Nif::BSShaderPPLightingProperty property;
property.recType = Nif::RC_BSShaderPPLightingProperty; property.mRecordType = Nif::RC_BSShaderPPLightingProperty;
property.mTextureSet = nullptr; property.mTextureSet = nullptr;
property.mController = nullptr; property.mController = nullptr;
property.mType = GetParam().mShaderType; property.mType = GetParam().mShaderType;
@ -285,7 +285,7 @@ osg::Group {
Nif::NiAVObject node; Nif::NiAVObject node;
init(node); init(node);
Nif::BSLightingShaderProperty property; Nif::BSLightingShaderProperty property;
property.recType = Nif::RC_BSLightingShaderProperty; property.mRecordType = Nif::RC_BSLightingShaderProperty;
property.mTextureSet = nullptr; property.mTextureSet = nullptr;
property.mController = nullptr; property.mController = nullptr;
property.mType = GetParam().mShaderType; property.mType = GetParam().mShaderType;

View file

@ -532,7 +532,7 @@ namespace Nif
// Is this possible? // Is this possible?
if (numKeys != 0) if (numKeys != 0)
throw Nif::Exception( throw Nif::Exception(
"Unsupported keys in bhkBlendController " + std::to_string(recIndex), nif->getFile().getFilename()); "Unsupported keys in bhkBlendController " + std::to_string(mRecordIndex), nif->getFile().getFilename());
} }
void BSEffectShaderPropertyFloatController::read(NIFStream* nif) void BSEffectShaderPropertyFloatController::read(NIFStream* nif)

View file

@ -95,7 +95,7 @@ namespace Nif
nif->read(mNumVertices); nif->read(mNumVertices);
bool isPSysData = false; bool isPSysData = false;
switch (recType) switch (mRecordType)
{ {
case RC_NiPSysData: case RC_NiPSysData:
case RC_NiMeshPSysData: case RC_NiMeshPSysData:
@ -599,7 +599,7 @@ namespace Nif
nif->read(mNumVertices); nif->read(mNumVertices);
nif->readVectorOfRecords<uint32_t>(mBlockInfos); nif->readVectorOfRecords<uint32_t>(mBlockInfos);
const ReadNiAdditionalGeometryDataDataBlock readDataBlock{ .mBSPacked const ReadNiAdditionalGeometryDataDataBlock readDataBlock{ .mBSPacked
= recType == RC_BSPackedAdditionalGeometryData }; = mRecordType == RC_BSPackedAdditionalGeometryData };
nif->readVectorOfRecords<uint32_t>(readDataBlock, mBlocks); nif->readVectorOfRecords<uint32_t>(readDataBlock, mBlocks);
} }

View file

@ -41,7 +41,7 @@ namespace Nif
static std::unique_ptr<Record> construct() static std::unique_ptr<Record> construct()
{ {
auto result = std::make_unique<NodeType>(); auto result = std::make_unique<NodeType>();
result->recType = recordType; result->mRecordType = recordType;
return result; return result;
} }
@ -699,9 +699,9 @@ namespace Nif
Log(Debug::Verbose) << "NIF Debug: Reading record of type " << rec << ", index " << i; Log(Debug::Verbose) << "NIF Debug: Reading record of type " << rec << ", index " << i;
assert(r != nullptr); assert(r != nullptr);
assert(r->recType != RC_MISSING); assert(r->mRecordType != RC_MISSING);
r->recName = std::move(rec); r->mRecordName = std::move(rec);
r->recIndex = static_cast<unsigned>(i); r->mRecordIndex = static_cast<unsigned>(i);
r->read(&nif); r->read(&nif);
mRecords.push_back(std::move(r)); mRecords.push_back(std::move(r));
} }

View file

@ -185,7 +185,7 @@ namespace Nif
// FIXME: if node 0 is *not* the only root node, this must not happen. // FIXME: if node 0 is *not* the only root node, this must not happen.
// FIXME: doing this here is awful. // FIXME: doing this here is awful.
// We want to do this on world scene graph level rather than local scene graph level. // We want to do this on world scene graph level rather than local scene graph level.
if (recIndex == 0 && !Misc::StringUtils::ciEqual(mName, "bip01")) if (mRecordIndex == 0 && !Misc::StringUtils::ciEqual(mName, "bip01"))
{ {
mTransform = Nif::NiTransform::getIdentity(); mTransform = Nif::NiTransform::getIdentity();
} }
@ -247,29 +247,29 @@ namespace Nif
mSkin.post(nif); mSkin.post(nif);
mShaderProperty.post(nif); mShaderProperty.post(nif);
mAlphaProperty.post(nif); mAlphaProperty.post(nif);
if (recType != RC_NiParticles && !mSkin.empty()) if (mRecordType != RC_NiParticles && !mSkin.empty())
nif.setUseSkinning(true); nif.setUseSkinning(true);
if (!mData.empty()) if (!mData.empty())
{ {
switch (recType) switch (mRecordType)
{ {
case RC_NiTriShape: case RC_NiTriShape:
case RC_BSLODTriShape: case RC_BSLODTriShape:
case RC_BSSegmentedTriShape: case RC_BSSegmentedTriShape:
if (mData->recType != RC_NiTriShapeData) if (mData->mRecordType != RC_NiTriShapeData)
mData = NiGeometryDataPtr(nullptr); mData = NiGeometryDataPtr(nullptr);
break; break;
case RC_NiTriStrips: case RC_NiTriStrips:
if (mData->recType != RC_NiTriStripsData) if (mData->mRecordType != RC_NiTriStripsData)
mData = NiGeometryDataPtr(nullptr); mData = NiGeometryDataPtr(nullptr);
break; break;
case RC_NiParticles: case RC_NiParticles:
if (mData->recType != RC_NiParticlesData) if (mData->mRecordType != RC_NiParticlesData)
mData = NiGeometryDataPtr(nullptr); mData = NiGeometryDataPtr(nullptr);
break; break;
case RC_NiLines: case RC_NiLines:
if (mData->recType != RC_NiLinesData) if (mData->mRecordType != RC_NiLinesData)
mData = NiGeometryDataPtr(nullptr); mData = NiGeometryDataPtr(nullptr);
break; break;
default: default:

View file

@ -129,7 +129,9 @@ namespace Nif
void BSShaderProperty::read(NIFStream* nif) void BSShaderProperty::read(NIFStream* nif)
{ {
if (nif->getBethVersion() < NIFFile::BethVersion::BETHVER_F76 && recType == RC_BSLightingShaderProperty) const bool isF76OrNewer = nif->getBethVersion() >= NIFFile::BethVersion::BETHVER_F76;
const bool isLightingShader = mRecordType == RC_BSLightingShaderProperty;
if (!isF76OrNewer && isLightingShader)
nif->read(mType); nif->read(mType);
NiShadeProperty::read(nif); NiShadeProperty::read(nif);
@ -143,7 +145,7 @@ namespace Nif
return; return;
} }
if (!mName.empty() && nif->getBethVersion() >= NIFFile::BethVersion::BETHVER_F76) if (!mName.empty() && isF76OrNewer)
return; return;
if (nif->getBethVersion() <= 131) if (nif->getBethVersion() <= 131)
@ -153,7 +155,7 @@ namespace Nif
} }
else else
{ {
if (nif->getBethVersion() >= NIFFile::BethVersion::BETHVER_F76 && recType == RC_BSLightingShaderProperty) if (isF76OrNewer && isLightingShader)
{ {
nif->read(mType); nif->read(mType);

View file

@ -323,10 +323,9 @@ namespace Nif
/// Base class for all records /// Base class for all records
struct Record struct Record
{ {
// Record type and type name RecordType mRecordType{ RC_MISSING };
RecordType recType{ RC_MISSING }; std::string mRecordName;
std::string recName; unsigned int mRecordIndex{ ~0u };
unsigned int recIndex{ ~0u };
Record() = default; Record() = default;

View file

@ -115,7 +115,7 @@ namespace NifBullet
const Nif::NiIntegerExtraData* bsxFlags = nullptr; const Nif::NiIntegerExtraData* bsxFlags = nullptr;
for (const auto& e : node.getExtraList()) for (const auto& e : node.getExtraList())
{ {
if (e->recType == Nif::RC_BSXFlags) if (e->mRecordType == Nif::RC_BSXFlags)
{ {
bsxFlags = static_cast<const Nif::NiIntegerExtraData*>(e.getPtr()); bsxFlags = static_cast<const Nif::NiIntegerExtraData*>(e.getPtr());
break; break;
@ -142,7 +142,7 @@ namespace NifBullet
{ {
for (const auto& child : ninode->mChildren) for (const auto& child : ninode->mChildren)
{ {
if (!child.empty() && child.getPtr()->recType == Nif::RC_RootCollisionNode) if (!child.empty() && child->mRecordType == Nif::RC_RootCollisionNode)
{ {
colNode = static_cast<const Nif::NiNode*>(child.getPtr()); colNode = static_cast<const Nif::NiNode*>(child.getPtr());
break; break;
@ -155,7 +155,7 @@ namespace NifBullet
// Check for extra data // Check for extra data
for (const auto& e : node.getExtraList()) for (const auto& e : node.getExtraList())
{ {
if (e->recType == Nif::RC_NiStringExtraData) if (e->mRecordType == Nif::RC_NiStringExtraData)
{ {
// String markers may contain important information // String markers may contain important information
// affecting the entire subtree of this node // affecting the entire subtree of this node
@ -192,7 +192,7 @@ namespace NifBullet
void BulletNifLoader::handleNode(const Nif::NiAVObject& node, const Nif::Parent* parent, HandleNodeArgs args) void BulletNifLoader::handleNode(const Nif::NiAVObject& node, const Nif::Parent* parent, HandleNodeArgs args)
{ {
// TODO: allow on-the fly collision switching via toggling this flag // TODO: allow on-the fly collision switching via toggling this flag
if (node.recType == Nif::RC_NiCollisionSwitch && !node.collisionActive()) if (node.mRecordType == Nif::RC_NiCollisionSwitch && !node.collisionActive())
return; return;
for (Nif::NiTimeControllerPtr ctrl = node.mController; !ctrl.empty(); ctrl = ctrl->mNext) for (Nif::NiTimeControllerPtr ctrl = node.mController; !ctrl.empty(); ctrl = ctrl->mNext)
@ -201,7 +201,7 @@ namespace NifBullet
break; break;
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
switch (ctrl->recType) switch (ctrl->mRecordType)
{ {
case Nif::RC_NiKeyframeController: case Nif::RC_NiKeyframeController:
case Nif::RC_NiPathController: case Nif::RC_NiPathController:
@ -213,7 +213,7 @@ namespace NifBullet
} }
} }
if (node.recType == Nif::RC_RootCollisionNode) if (node.mRecordType == Nif::RC_RootCollisionNode)
{ {
if (args.mAutogenerated) if (args.mAutogenerated)
{ {
@ -235,7 +235,7 @@ namespace NifBullet
} }
// Don't collide with AvoidNode shapes // Don't collide with AvoidNode shapes
if (node.recType == Nif::RC_AvoidNode) if (node.mRecordType == Nif::RC_AvoidNode)
args.mAvoid = true; args.mAvoid = true;
if (args.mAutogenerated || args.mIsCollisionNode) if (args.mAutogenerated || args.mIsCollisionNode)
@ -259,7 +259,7 @@ namespace NifBullet
// For NiSwitchNodes and NiFltAnimationNodes, only use the first child // For NiSwitchNodes and NiFltAnimationNodes, only use the first child
// TODO: must synchronize with the rendering scene graph somehow // TODO: must synchronize with the rendering scene graph somehow
// Doing this for NiLODNodes is unsafe (the first level might not be the closest) // Doing this for NiLODNodes is unsafe (the first level might not be the closest)
if (node.recType == Nif::RC_NiSwitchNode || node.recType == Nif::RC_NiFltAnimationNode) if (node.mRecordType == Nif::RC_NiSwitchNode || node.mRecordType == Nif::RC_NiFltAnimationNode)
break; break;
} }
} }
@ -314,7 +314,7 @@ namespace NifBullet
mCompoundShape.reset(new btCompoundShape); mCompoundShape.reset(new btCompoundShape);
if (args.mAnimated) if (args.mAnimated)
mShape->mAnimatedShapes.emplace(niGeometry.recIndex, mCompoundShape->getNumChildShapes()); mShape->mAnimatedShapes.emplace(niGeometry.mRecordIndex, mCompoundShape->getNumChildShapes());
mCompoundShape->addChildShape(trans, childShape.get()); mCompoundShape->addChildShape(trans, childShape.get());
} }
else else

View file

@ -94,7 +94,7 @@ namespace NifOsg
{ {
if (!keyctrl->mInterpolator.empty()) if (!keyctrl->mInterpolator.empty())
{ {
if (keyctrl->mInterpolator->recType == Nif::RC_NiTransformInterpolator) if (keyctrl->mInterpolator->mRecordType == Nif::RC_NiTransformInterpolator)
{ {
const Nif::NiTransformInterpolator* interp const Nif::NiTransformInterpolator* interp
= static_cast<const Nif::NiTransformInterpolator*>(keyctrl->mInterpolator.getPtr()); = static_cast<const Nif::NiTransformInterpolator*>(keyctrl->mInterpolator.getPtr());
@ -248,7 +248,7 @@ namespace NifOsg
for (std::size_t i = 0, n = ctrl->mInterpolators.size(); i < n; ++i) for (std::size_t i = 0, n = ctrl->mInterpolators.size(); i < n; ++i)
{ {
if (!ctrl->mInterpolators[i].empty() && ctrl->mInterpolators[i]->recType == Nif::RC_NiFloatInterpolator) if (!ctrl->mInterpolators[i].empty() && ctrl->mInterpolators[i]->mRecordType == Nif::RC_NiFloatInterpolator)
{ {
auto interpolator = static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolators[i].getPtr()); auto interpolator = static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolators[i].getPtr());
mKeyFrames[i] = FloatInterpolator(interpolator); mKeyFrames[i] = FloatInterpolator(interpolator);
@ -346,7 +346,7 @@ namespace NifOsg
{ {
if (!ctrl->mInterpolator.empty()) if (!ctrl->mInterpolator.empty())
{ {
if (ctrl->mInterpolator->recType != Nif::RC_NiBoolInterpolator) if (ctrl->mInterpolator->mRecordType != Nif::RC_NiBoolInterpolator)
return; return;
mInterpolator = { static_cast<const Nif::NiBoolInterpolator*>(ctrl->mInterpolator.getPtr()) }; mInterpolator = { static_cast<const Nif::NiBoolInterpolator*>(ctrl->mInterpolator.getPtr()) };
@ -395,7 +395,7 @@ namespace NifOsg
{ {
if (!ctrl->mInterpolator.empty()) if (!ctrl->mInterpolator.empty())
{ {
if (ctrl->mInterpolator->recType == Nif::RC_NiFloatInterpolator) if (ctrl->mInterpolator->mRecordType == Nif::RC_NiFloatInterpolator)
mData = FloatInterpolator(static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolator.getPtr())); mData = FloatInterpolator(static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolator.getPtr()));
} }
else if (!ctrl->mData.empty()) else if (!ctrl->mData.empty())
@ -441,7 +441,7 @@ namespace NifOsg
{ {
if (!ctrl->mInterpolator.empty()) if (!ctrl->mInterpolator.empty())
{ {
if (ctrl->mInterpolator->recType == Nif::RC_NiFloatInterpolator) if (ctrl->mInterpolator->mRecordType == Nif::RC_NiFloatInterpolator)
mData = FloatInterpolator(static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolator.getPtr())); mData = FloatInterpolator(static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolator.getPtr()));
} }
else if (!ctrl->mData.empty()) else if (!ctrl->mData.empty())
@ -483,7 +483,7 @@ namespace NifOsg
{ {
if (!ctrl->mInterpolator.empty()) if (!ctrl->mInterpolator.empty())
{ {
if (ctrl->mInterpolator->recType == Nif::RC_NiPoint3Interpolator) if (ctrl->mInterpolator->mRecordType == Nif::RC_NiPoint3Interpolator)
mData = Vec3Interpolator(static_cast<const Nif::NiPoint3Interpolator*>(ctrl->mInterpolator.getPtr())); mData = Vec3Interpolator(static_cast<const Nif::NiPoint3Interpolator*>(ctrl->mInterpolator.getPtr()));
} }
else if (!ctrl->mData.empty()) else if (!ctrl->mData.empty())
@ -552,7 +552,7 @@ namespace NifOsg
, mDelta(ctrl->mDelta) , mDelta(ctrl->mDelta)
, mTextures(textures) , mTextures(textures)
{ {
if (!ctrl->mInterpolator.empty() && ctrl->mInterpolator->recType == Nif::RC_NiFloatInterpolator) if (!ctrl->mInterpolator.empty() && ctrl->mInterpolator->mRecordType == Nif::RC_NiFloatInterpolator)
mData = static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolator.getPtr()); mData = static_cast<const Nif::NiFloatInterpolator*>(ctrl->mInterpolator.getPtr());
} }

View file

@ -87,7 +87,7 @@ namespace
{ {
if (const Nif::NiNode* ninode = dynamic_cast<const Nif::NiNode*>(node)) if (const Nif::NiNode* ninode = dynamic_cast<const Nif::NiNode*>(node))
{ {
outIndices.push_back(ninode->recIndex); outIndices.push_back(ninode->mRecordIndex);
for (const auto& child : ninode->mChildren) for (const auto& child : ninode->mChildren)
if (!child.empty()) if (!child.empty())
getAllNiNodes(child.getPtr(), outIndices); getAllNiNodes(child.getPtr(), outIndices);
@ -132,7 +132,7 @@ namespace
{ {
if (!property.empty()) if (!property.empty())
{ {
switch (property->recType) switch (property->mRecordType)
{ {
case Nif::RC_NiMaterialProperty: case Nif::RC_NiMaterialProperty:
case Nif::RC_NiVertexColorProperty: case Nif::RC_NiVertexColorProperty:
@ -314,7 +314,7 @@ namespace NifOsg
for (size_t i = 0; i < numRoots; ++i) for (size_t i = 0; i < numRoots; ++i)
{ {
const Nif::Record* r = nif.getRoot(i); const Nif::Record* r = nif.getRoot(i);
if (r && r->recType == Nif::RC_NiSequenceStreamHelper) if (r && r->mRecordType == Nif::RC_NiSequenceStreamHelper)
{ {
seq = static_cast<const Nif::NiSequenceStreamHelper*>(r); seq = static_cast<const Nif::NiSequenceStreamHelper*>(r);
break; break;
@ -336,10 +336,10 @@ namespace NifOsg
return; return;
} }
if (extraList[0]->recType != Nif::RC_NiTextKeyExtraData) if (extraList[0]->mRecordType != Nif::RC_NiTextKeyExtraData)
{ {
Log(Debug::Warning) << "NIFFile Warning: First extra data was not a NiTextKeyExtraData, but a " Log(Debug::Warning) << "NIFFile Warning: First extra data was not a NiTextKeyExtraData, but a "
<< std::string_view(extraList[0]->recName) << ". File: " << nif.getFilename(); << std::string_view(extraList[0]->mRecordName) << ". File: " << nif.getFilename();
return; return;
} }
@ -350,10 +350,11 @@ namespace NifOsg
for (size_t i = 1; i < extraList.size() && !ctrl.empty(); i++, (ctrl = ctrl->mNext)) for (size_t i = 1; i < extraList.size() && !ctrl.empty(); i++, (ctrl = ctrl->mNext))
{ {
Nif::ExtraPtr extra = extraList[i]; Nif::ExtraPtr extra = extraList[i];
if (extra->recType != Nif::RC_NiStringExtraData || ctrl->recType != Nif::RC_NiKeyframeController) if (extra->mRecordType != Nif::RC_NiStringExtraData
|| ctrl->mRecordType != Nif::RC_NiKeyframeController)
{ {
Log(Debug::Warning) << "NIFFile Warning: Unexpected extra data " << extra->recName Log(Debug::Warning) << "NIFFile Warning: Unexpected extra data " << extra->mRecordName
<< " with controller " << ctrl->recName << ". File: " << nif.getFilename(); << " with controller " << ctrl->mRecordName << ". File: " << nif.getFilename();
continue; continue;
} }
@ -366,9 +367,9 @@ namespace NifOsg
if (key->mData.empty() && key->mInterpolator.empty()) if (key->mData.empty() && key->mInterpolator.empty())
continue; continue;
if (!key->mInterpolator.empty() && key->mInterpolator->recType != Nif::RC_NiTransformInterpolator) if (!key->mInterpolator.empty() && key->mInterpolator->mRecordType != Nif::RC_NiTransformInterpolator)
{ {
Log(Debug::Error) << "Unsupported interpolator type for NiKeyframeController " << key->recIndex Log(Debug::Error) << "Unsupported interpolator type for NiKeyframeController " << key->mRecordIndex
<< " in " << mFilename; << " in " << mFilename;
continue; continue;
} }
@ -458,7 +459,7 @@ namespace NifOsg
if (property.empty()) if (property.empty())
continue; continue;
if (property.getPtr()->recType == Nif::RC_NiStencilProperty) if (property->mRecordType == Nif::RC_NiStencilProperty)
{ {
const Nif::NiStencilProperty* stencilprop const Nif::NiStencilProperty* stencilprop
= static_cast<const Nif::NiStencilProperty*>(property.getPtr()); = static_cast<const Nif::NiStencilProperty*>(property.getPtr());
@ -474,17 +475,17 @@ namespace NifOsg
{ {
if (!property.empty()) if (!property.empty())
{ {
// Get the lowest numbered recIndex of the NiTexturingProperty root node. // Get the lowest numbered record index of the NiTexturingProperty root node.
// This is what is overridden when a spell effect "particle texture" is used. // This is what is overridden when a spell effect "particle texture" is used.
if (nifNode->mParents.empty() && !mFoundFirstRootTexturingProperty if (nifNode->mParents.empty() && !mFoundFirstRootTexturingProperty
&& property.getPtr()->recType == Nif::RC_NiTexturingProperty) && property->mRecordType == Nif::RC_NiTexturingProperty)
{ {
mFirstRootTextureIndex = property.getPtr()->recIndex; mFirstRootTextureIndex = property->mRecordIndex;
mFoundFirstRootTexturingProperty = true; mFoundFirstRootTexturingProperty = true;
} }
else if (property.getPtr()->recType == Nif::RC_NiTexturingProperty) else if (property->mRecordType == Nif::RC_NiTexturingProperty)
{ {
if (property.getPtr()->recIndex == mFirstRootTextureIndex) if (property->mRecordIndex == mFirstRootTextureIndex)
applyTo->setUserValue("overrideFx", 1); applyTo->setUserValue("overrideFx", 1);
} }
handleProperty(property.getPtr(), applyTo, composite, boundTextures, animflags, hasStencilProperty); handleProperty(property.getPtr(), applyTo, composite, boundTextures, animflags, hasStencilProperty);
@ -493,9 +494,9 @@ namespace NifOsg
// NiAlphaProperty is handled as a drawable property // NiAlphaProperty is handled as a drawable property
Nif::BSShaderPropertyPtr shaderprop = nullptr; Nif::BSShaderPropertyPtr shaderprop = nullptr;
if (isTypeNiGeometry(nifNode->recType)) if (isTypeNiGeometry(nifNode->mRecordType))
shaderprop = static_cast<const Nif::NiGeometry*>(nifNode)->mShaderProperty; shaderprop = static_cast<const Nif::NiGeometry*>(nifNode)->mShaderProperty;
else if (isTypeBSGeometry(nifNode->recType)) else if (isTypeBSGeometry(nifNode->mRecordType))
shaderprop = static_cast<const Nif::BSTriShape*>(nifNode)->mShaderProperty; shaderprop = static_cast<const Nif::BSTriShape*>(nifNode)->mShaderProperty;
if (!shaderprop.empty()) if (!shaderprop.empty())
@ -579,9 +580,9 @@ namespace NifOsg
bool handleEffect(const Nif::NiAVObject* nifNode, osg::StateSet* stateset) const bool handleEffect(const Nif::NiAVObject* nifNode, osg::StateSet* stateset) const
{ {
if (nifNode->recType != Nif::RC_NiTextureEffect) if (nifNode->mRecordType != Nif::RC_NiTextureEffect)
{ {
Log(Debug::Info) << "Unhandled effect " << nifNode->recName << " in " << mFilename; Log(Debug::Info) << "Unhandled effect " << nifNode->mRecordName << " in " << mFilename;
return false; return false;
} }
@ -639,7 +640,7 @@ namespace NifOsg
osg::ref_ptr<osg::Group> node; osg::ref_ptr<osg::Group> node;
osg::Object::DataVariance dataVariance = osg::Object::UNSPECIFIED; osg::Object::DataVariance dataVariance = osg::Object::UNSPECIFIED;
switch (nifNode->recType) switch (nifNode->mRecordType)
{ {
case Nif::RC_NiBillboardNode: case Nif::RC_NiBillboardNode:
dataVariance = osg::Object::DYNAMIC; dataVariance = osg::Object::DYNAMIC;
@ -672,7 +673,7 @@ namespace NifOsg
osg::ref_ptr<osg::Group> node = createNode(nifNode); osg::ref_ptr<osg::Group> node = createNode(nifNode);
if (nifNode->recType == Nif::RC_NiBillboardNode) if (nifNode->mRecordType == Nif::RC_NiBillboardNode)
{ {
node->addCullCallback(new BillboardCallback); node->addCullCallback(new BillboardCallback);
} }
@ -689,18 +690,18 @@ namespace NifOsg
// - finding the correct emitter node for a particle system // - finding the correct emitter node for a particle system
// - establishing connections to the animated collision shapes, which are handled in a separate loader // - establishing connections to the animated collision shapes, which are handled in a separate loader
// - finding a random child NiNode in NiBspArrayController // - finding a random child NiNode in NiBspArrayController
node->setUserValue("recIndex", nifNode->recIndex); node->setUserValue("recIndex", nifNode->mRecordIndex);
std::string extraData; std::string extraData;
for (const auto& e : nifNode->getExtraList()) for (const auto& e : nifNode->getExtraList())
{ {
if (e->recType == Nif::RC_NiTextKeyExtraData && args.mTextKeys) if (e->mRecordType == Nif::RC_NiTextKeyExtraData && args.mTextKeys)
{ {
const Nif::NiTextKeyExtraData* tk = static_cast<const Nif::NiTextKeyExtraData*>(e.getPtr()); const Nif::NiTextKeyExtraData* tk = static_cast<const Nif::NiTextKeyExtraData*>(e.getPtr());
extractTextKeys(tk, *args.mTextKeys); extractTextKeys(tk, *args.mTextKeys);
} }
else if (e->recType == Nif::RC_NiStringExtraData) else if (e->mRecordType == Nif::RC_NiStringExtraData)
{ {
const Nif::NiStringExtraData* sd = static_cast<const Nif::NiStringExtraData*>(e.getPtr()); const Nif::NiStringExtraData* sd = static_cast<const Nif::NiStringExtraData*>(e.getPtr());
@ -723,7 +724,7 @@ namespace NifOsg
extraData = sd->mData.substr(extraDataIdentifer.length()); extraData = sd->mData.substr(extraDataIdentifer.length());
} }
} }
else if (e->recType == Nif::RC_BSXFlags) else if (e->mRecordType == Nif::RC_BSXFlags)
{ {
if (args.mRootNode != node) if (args.mRootNode != node)
continue; continue;
@ -735,17 +736,17 @@ namespace NifOsg
} }
} }
if (nifNode->recType == Nif::RC_NiBSAnimationNode || nifNode->recType == Nif::RC_NiBSParticleNode) if (nifNode->mRecordType == Nif::RC_NiBSAnimationNode || nifNode->mRecordType == Nif::RC_NiBSParticleNode)
args.mAnimFlags = nifNode->mFlags; args.mAnimFlags = nifNode->mFlags;
if (nifNode->recType == Nif::RC_NiSortAdjustNode) if (nifNode->mRecordType == Nif::RC_NiSortAdjustNode)
{ {
auto sortNode = static_cast<const Nif::NiSortAdjustNode*>(nifNode); auto sortNode = static_cast<const Nif::NiSortAdjustNode*>(nifNode);
if (sortNode->mSubSorter.empty()) if (sortNode->mSubSorter.empty())
{ {
Log(Debug::Warning) << "Empty accumulator found in '" << nifNode->recName << "' node " Log(Debug::Warning) << "Empty accumulator found in '" << nifNode->mRecordName << "' node "
<< nifNode->recIndex; << nifNode->mRecordIndex;
} }
else else
{ {
@ -758,7 +759,7 @@ namespace NifOsg
// Hide collision shapes, but don't skip the subgraph // Hide collision shapes, but don't skip the subgraph
// We still need to animate the hidden bones so the physics system can access them // We still need to animate the hidden bones so the physics system can access them
if (nifNode->recType == Nif::RC_RootCollisionNode) if (nifNode->mRecordType == Nif::RC_RootCollisionNode)
{ {
args.mSkipMeshes = true; args.mSkipMeshes = true;
node->setNodeMask(Loader::getHiddenNodeMask()); node->setNodeMask(Loader::getHiddenNodeMask());
@ -771,7 +772,7 @@ namespace NifOsg
bool hasVisController = false; bool hasVisController = false;
for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext) for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
hasVisController |= (ctrl->recType == Nif::RC_NiVisController); hasVisController |= (ctrl->mRecordType == Nif::RC_NiVisController);
if (hasVisController) if (hasVisController)
break; break;
} }
@ -783,7 +784,7 @@ namespace NifOsg
node->setNodeMask(Loader::getHiddenNodeMask()); node->setNodeMask(Loader::getHiddenNodeMask());
} }
if (nifNode->recType == Nif::RC_NiCollisionSwitch && !nifNode->collisionActive()) if (nifNode->mRecordType == Nif::RC_NiCollisionSwitch && !nifNode->collisionActive())
{ {
node->setNodeMask(Loader::getIntersectionDisabledNodeMask()); node->setNodeMask(Loader::getIntersectionDisabledNodeMask());
// Don't let the optimizer mess with this node // Don't let the optimizer mess with this node
@ -794,11 +795,11 @@ namespace NifOsg
applyNodeProperties(nifNode, node, composite, args.mBoundTextures, args.mAnimFlags); applyNodeProperties(nifNode, node, composite, args.mBoundTextures, args.mAnimFlags);
if (nifNode->recType == Nif::RC_NiParticles) if (nifNode->mRecordType == Nif::RC_NiParticles)
handleParticleSystem(nifNode, parent, node, composite, args.mAnimFlags); handleParticleSystem(nifNode, parent, node, composite, args.mAnimFlags);
const bool isNiGeometry = isTypeNiGeometry(nifNode->recType); const bool isNiGeometry = isTypeNiGeometry(nifNode->mRecordType);
const bool isBSGeometry = isTypeBSGeometry(nifNode->recType); const bool isBSGeometry = isTypeBSGeometry(nifNode->mRecordType);
const bool isGeometry = isNiGeometry || isBSGeometry; const bool isGeometry = isNiGeometry || isBSGeometry;
if (isGeometry && !args.mSkipMeshes) if (isGeometry && !args.mSkipMeshes)
@ -856,7 +857,7 @@ namespace NifOsg
// transform to the caller of handleNode instead of the actual LOD/Switch nodes. // transform to the caller of handleNode instead of the actual LOD/Switch nodes.
osg::ref_ptr<osg::Group> currentNode = node; osg::ref_ptr<osg::Group> currentNode = node;
if (nifNode->recType == Nif::RC_NiSwitchNode) if (nifNode->mRecordType == Nif::RC_NiSwitchNode)
{ {
const Nif::NiSwitchNode* niSwitchNode = static_cast<const Nif::NiSwitchNode*>(nifNode); const Nif::NiSwitchNode* niSwitchNode = static_cast<const Nif::NiSwitchNode*>(nifNode);
osg::ref_ptr<osg::Switch> switchNode = handleSwitchNode(niSwitchNode); osg::ref_ptr<osg::Switch> switchNode = handleSwitchNode(niSwitchNode);
@ -868,14 +869,14 @@ namespace NifOsg
currentNode = switchNode; currentNode = switchNode;
} }
else if (nifNode->recType == Nif::RC_NiLODNode) else if (nifNode->mRecordType == Nif::RC_NiLODNode)
{ {
const Nif::NiLODNode* niLodNode = static_cast<const Nif::NiLODNode*>(nifNode); const Nif::NiLODNode* niLodNode = static_cast<const Nif::NiLODNode*>(nifNode);
osg::ref_ptr<osg::LOD> lodNode = handleLodNode(niLodNode); osg::ref_ptr<osg::LOD> lodNode = handleLodNode(niLodNode);
node->addChild(lodNode); node->addChild(lodNode);
currentNode = lodNode; currentNode = lodNode;
} }
else if (nifNode->recType == Nif::RC_NiFltAnimationNode) else if (nifNode->mRecordType == Nif::RC_NiFltAnimationNode)
{ {
osg::ref_ptr<osg::Sequence> sequenceNode = prepareSequenceNode(nifNode); osg::ref_ptr<osg::Sequence> sequenceNode = prepareSequenceNode(nifNode);
node->addChild(sequenceNode); node->addChild(sequenceNode);
@ -904,7 +905,7 @@ namespace NifOsg
} }
} }
if (nifNode->recType == Nif::RC_NiFltAnimationNode) if (nifNode->mRecordType == Nif::RC_NiFltAnimationNode)
activateSequenceNode(currentNode, nifNode); activateSequenceNode(currentNode, nifNode);
return node; return node;
@ -918,7 +919,7 @@ namespace NifOsg
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
if (ctrl->recType == Nif::RC_NiUVController) if (ctrl->mRecordType == Nif::RC_NiUVController)
{ {
const Nif::NiUVController* niuvctrl = static_cast<const Nif::NiUVController*>(ctrl.getPtr()); const Nif::NiUVController* niuvctrl = static_cast<const Nif::NiUVController*>(ctrl.getPtr());
if (niuvctrl->mData.empty()) if (niuvctrl->mData.empty())
@ -945,15 +946,17 @@ namespace NifOsg
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
if (ctrl->recType == Nif::RC_NiKeyframeController) if (ctrl->mRecordType == Nif::RC_NiKeyframeController)
{ {
const Nif::NiKeyframeController* key = static_cast<const Nif::NiKeyframeController*>(ctrl.getPtr()); const Nif::NiKeyframeController* key = static_cast<const Nif::NiKeyframeController*>(ctrl.getPtr());
if (key->mData.empty() && key->mInterpolator.empty()) if (key->mData.empty() && key->mInterpolator.empty())
continue; continue;
if (!key->mInterpolator.empty() && key->mInterpolator->recType != Nif::RC_NiTransformInterpolator) if (!key->mInterpolator.empty()
&& key->mInterpolator->mRecordType != Nif::RC_NiTransformInterpolator)
{ {
Log(Debug::Error) << "Unsupported interpolator type for NiKeyframeController " << key->recIndex Log(Debug::Error)
<< " in " << mFilename << ": " << key->mInterpolator->recName; << "Unsupported interpolator type for NiKeyframeController " << key->mRecordIndex << " in "
<< mFilename << ": " << key->mInterpolator->mRecordName;
continue; continue;
} }
osg::ref_ptr<KeyframeController> callback = new KeyframeController(key); osg::ref_ptr<KeyframeController> callback = new KeyframeController(key);
@ -961,7 +964,7 @@ namespace NifOsg
node->addUpdateCallback(callback); node->addUpdateCallback(callback);
isAnimated = true; isAnimated = true;
} }
else if (ctrl->recType == Nif::RC_NiPathController) else if (ctrl->mRecordType == Nif::RC_NiPathController)
{ {
const Nif::NiPathController* path = static_cast<const Nif::NiPathController*>(ctrl.getPtr()); const Nif::NiPathController* path = static_cast<const Nif::NiPathController*>(ctrl.getPtr());
if (path->mPathData.empty() || path->mPercentData.empty()) if (path->mPathData.empty() || path->mPercentData.empty())
@ -971,32 +974,34 @@ namespace NifOsg
node->addUpdateCallback(callback); node->addUpdateCallback(callback);
isAnimated = true; isAnimated = true;
} }
else if (ctrl->recType == Nif::RC_NiVisController) else if (ctrl->mRecordType == Nif::RC_NiVisController)
{ {
const Nif::NiVisController* visctrl = static_cast<const Nif::NiVisController*>(ctrl.getPtr()); const Nif::NiVisController* visctrl = static_cast<const Nif::NiVisController*>(ctrl.getPtr());
if (visctrl->mData.empty() && visctrl->mInterpolator.empty()) if (visctrl->mData.empty() && visctrl->mInterpolator.empty())
continue; continue;
if (!visctrl->mInterpolator.empty() if (!visctrl->mInterpolator.empty()
&& visctrl->mInterpolator->recType != Nif::RC_NiBoolInterpolator) && visctrl->mInterpolator->mRecordType != Nif::RC_NiBoolInterpolator)
{ {
Log(Debug::Error) << "Unsupported interpolator type for NiVisController " << visctrl->recIndex Log(Debug::Error)
<< " in " << mFilename << ": " << visctrl->mInterpolator->recName; << "Unsupported interpolator type for NiVisController " << visctrl->mRecordIndex << " in "
<< mFilename << ": " << visctrl->mInterpolator->mRecordName;
continue; continue;
} }
osg::ref_ptr<VisController> callback(new VisController(visctrl, Loader::getHiddenNodeMask())); osg::ref_ptr<VisController> callback(new VisController(visctrl, Loader::getHiddenNodeMask()));
setupController(visctrl, callback, animflags); setupController(visctrl, callback, animflags);
node->addUpdateCallback(callback); node->addUpdateCallback(callback);
} }
else if (ctrl->recType == Nif::RC_NiRollController) else if (ctrl->mRecordType == Nif::RC_NiRollController)
{ {
const Nif::NiRollController* rollctrl = static_cast<const Nif::NiRollController*>(ctrl.getPtr()); const Nif::NiRollController* rollctrl = static_cast<const Nif::NiRollController*>(ctrl.getPtr());
if (rollctrl->mData.empty() && rollctrl->mInterpolator.empty()) if (rollctrl->mData.empty() && rollctrl->mInterpolator.empty())
continue; continue;
if (!rollctrl->mInterpolator.empty() if (!rollctrl->mInterpolator.empty()
&& rollctrl->mInterpolator->recType != Nif::RC_NiFloatInterpolator) && rollctrl->mInterpolator->mRecordType != Nif::RC_NiFloatInterpolator)
{ {
Log(Debug::Error) << "Unsupported interpolator type for NiRollController " << rollctrl->recIndex Log(Debug::Error)
<< " in " << mFilename << ": " << rollctrl->mInterpolator->recName; << "Unsupported interpolator type for NiRollController " << rollctrl->mRecordIndex << " in "
<< mFilename << ": " << rollctrl->mInterpolator->mRecordName;
continue; continue;
} }
osg::ref_ptr<RollController> callback = new RollController(rollctrl); osg::ref_ptr<RollController> callback = new RollController(rollctrl);
@ -1004,15 +1009,15 @@ namespace NifOsg
node->addUpdateCallback(callback); node->addUpdateCallback(callback);
isAnimated = true; isAnimated = true;
} }
else if (ctrl->recType == Nif::RC_NiGeomMorpherController else if (ctrl->mRecordType == Nif::RC_NiGeomMorpherController
|| ctrl->recType == Nif::RC_NiParticleSystemController || ctrl->mRecordType == Nif::RC_NiParticleSystemController
|| ctrl->recType == Nif::RC_NiBSPArrayController || ctrl->recType == Nif::RC_NiUVController) || ctrl->mRecordType == Nif::RC_NiBSPArrayController || ctrl->mRecordType == Nif::RC_NiUVController)
{ {
// These controllers are handled elsewhere // These controllers are handled elsewhere
} }
else else
Log(Debug::Info) << "Unhandled controller " << ctrl->recName << " on node " << nifNode->recIndex Log(Debug::Info) << "Unhandled controller " << ctrl->mRecordName << " on node "
<< " in " << mFilename; << nifNode->mRecordIndex << " in " << mFilename;
} }
} }
@ -1023,24 +1028,24 @@ namespace NifOsg
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
if (ctrl->recType == Nif::RC_NiAlphaController) if (ctrl->mRecordType == Nif::RC_NiAlphaController)
{ {
const Nif::NiAlphaController* alphactrl = static_cast<const Nif::NiAlphaController*>(ctrl.getPtr()); const Nif::NiAlphaController* alphactrl = static_cast<const Nif::NiAlphaController*>(ctrl.getPtr());
if (alphactrl->mData.empty() && alphactrl->mInterpolator.empty()) if (alphactrl->mData.empty() && alphactrl->mInterpolator.empty())
continue; continue;
if (!alphactrl->mInterpolator.empty() if (!alphactrl->mInterpolator.empty()
&& alphactrl->mInterpolator->recType != Nif::RC_NiFloatInterpolator) && alphactrl->mInterpolator->mRecordType != Nif::RC_NiFloatInterpolator)
{ {
Log(Debug::Error) Log(Debug::Error)
<< "Unsupported interpolator type for NiAlphaController " << alphactrl->recIndex << " in " << "Unsupported interpolator type for NiAlphaController " << alphactrl->mRecordIndex
<< mFilename << ": " << alphactrl->mInterpolator->recName; << " in " << mFilename << ": " << alphactrl->mInterpolator->mRecordName;
continue; continue;
} }
osg::ref_ptr<AlphaController> osgctrl = new AlphaController(alphactrl, baseMaterial); osg::ref_ptr<AlphaController> osgctrl = new AlphaController(alphactrl, baseMaterial);
setupController(alphactrl, osgctrl, animflags); setupController(alphactrl, osgctrl, animflags);
composite->addController(osgctrl); composite->addController(osgctrl);
} }
else if (ctrl->recType == Nif::RC_NiMaterialColorController) else if (ctrl->mRecordType == Nif::RC_NiMaterialColorController)
{ {
const Nif::NiMaterialColorController* matctrl const Nif::NiMaterialColorController* matctrl
= static_cast<const Nif::NiMaterialColorController*>(ctrl.getPtr()); = static_cast<const Nif::NiMaterialColorController*>(ctrl.getPtr());
@ -1050,10 +1055,11 @@ namespace NifOsg
if (mVersion <= Nif::NIFFile::VER_MW if (mVersion <= Nif::NIFFile::VER_MW
&& matctrl->mTargetColor == Nif::NiMaterialColorController::TargetColor::Specular) && matctrl->mTargetColor == Nif::NiMaterialColorController::TargetColor::Specular)
continue; continue;
if (!interp.empty() && interp->recType != Nif::RC_NiPoint3Interpolator) if (!interp.empty() && interp->mRecordType != Nif::RC_NiPoint3Interpolator)
{ {
Log(Debug::Error) << "Unsupported interpolator type for NiMaterialColorController " Log(Debug::Error)
<< matctrl->recIndex << " in " << mFilename << ": " << interp->recName; << "Unsupported interpolator type for NiMaterialColorController " << matctrl->mRecordIndex
<< " in " << mFilename << ": " << interp->mRecordName;
continue; continue;
} }
osg::ref_ptr<MaterialColorController> osgctrl = new MaterialColorController(matctrl, baseMaterial); osg::ref_ptr<MaterialColorController> osgctrl = new MaterialColorController(matctrl, baseMaterial);
@ -1061,7 +1067,7 @@ namespace NifOsg
composite->addController(osgctrl); composite->addController(osgctrl);
} }
else else
Log(Debug::Info) << "Unexpected material controller " << ctrl->recType << " in " << mFilename; Log(Debug::Info) << "Unexpected material controller " << ctrl->mRecordType << " in " << mFilename;
} }
} }
@ -1125,14 +1131,15 @@ namespace NifOsg
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
if (ctrl->recType == Nif::RC_NiFlipController) if (ctrl->mRecordType == Nif::RC_NiFlipController)
{ {
const Nif::NiFlipController* flipctrl = static_cast<const Nif::NiFlipController*>(ctrl.getPtr()); const Nif::NiFlipController* flipctrl = static_cast<const Nif::NiFlipController*>(ctrl.getPtr());
if (!flipctrl->mInterpolator.empty() if (!flipctrl->mInterpolator.empty()
&& flipctrl->mInterpolator->recType != Nif::RC_NiFloatInterpolator) && flipctrl->mInterpolator->mRecordType != Nif::RC_NiFloatInterpolator)
{ {
Log(Debug::Error) << "Unsupported interpolator type for NiFlipController " << flipctrl->recIndex Log(Debug::Error)
<< " in " << mFilename << ": " << flipctrl->mInterpolator->recName; << "Unsupported interpolator type for NiFlipController " << flipctrl->mRecordIndex << " in "
<< mFilename << ": " << flipctrl->mInterpolator->mRecordName;
continue; continue;
} }
std::vector<osg::ref_ptr<osg::Texture2D>> textures; std::vector<osg::ref_ptr<osg::Texture2D>> textures;
@ -1165,7 +1172,7 @@ namespace NifOsg
composite->addController(callback); composite->addController(callback);
} }
else else
Log(Debug::Info) << "Unexpected texture controller " << ctrl->recName << " in " << mFilename; Log(Debug::Info) << "Unexpected texture controller " << ctrl->mRecordName << " in " << mFilename;
} }
} }
@ -1179,17 +1186,17 @@ namespace NifOsg
program->setReferenceFrame(rf); program->setReferenceFrame(rf);
for (; !modifier.empty(); modifier = modifier->mNext) for (; !modifier.empty(); modifier = modifier->mNext)
{ {
if (modifier->recType == Nif::RC_NiParticleGrowFade) if (modifier->mRecordType == Nif::RC_NiParticleGrowFade)
{ {
const Nif::NiParticleGrowFade* gf = static_cast<const Nif::NiParticleGrowFade*>(modifier.getPtr()); const Nif::NiParticleGrowFade* gf = static_cast<const Nif::NiParticleGrowFade*>(modifier.getPtr());
program->addOperator(new GrowFadeAffector(gf->mGrowTime, gf->mFadeTime)); program->addOperator(new GrowFadeAffector(gf->mGrowTime, gf->mFadeTime));
} }
else if (modifier->recType == Nif::RC_NiGravity) else if (modifier->mRecordType == Nif::RC_NiGravity)
{ {
const Nif::NiGravity* gr = static_cast<const Nif::NiGravity*>(modifier.getPtr()); const Nif::NiGravity* gr = static_cast<const Nif::NiGravity*>(modifier.getPtr());
program->addOperator(new GravityAffector(gr)); program->addOperator(new GravityAffector(gr));
} }
else if (modifier->recType == Nif::RC_NiParticleBomb) else if (modifier->mRecordType == Nif::RC_NiParticleBomb)
{ {
auto bomb = static_cast<const Nif::NiParticleBomb*>(modifier.getPtr()); auto bomb = static_cast<const Nif::NiParticleBomb*>(modifier.getPtr());
osg::ref_ptr<osgParticle::ModularProgram> bombProgram(new osgParticle::ModularProgram); osg::ref_ptr<osgParticle::ModularProgram> bombProgram(new osgParticle::ModularProgram);
@ -1201,7 +1208,7 @@ namespace NifOsg
bombProgram->setEndless(false); bombProgram->setEndless(false);
bombProgram->addOperator(new ParticleBomb(bomb)); bombProgram->addOperator(new ParticleBomb(bomb));
} }
else if (modifier->recType == Nif::RC_NiParticleColorModifier) else if (modifier->mRecordType == Nif::RC_NiParticleColorModifier)
{ {
const Nif::NiParticleColorModifier* cl const Nif::NiParticleColorModifier* cl
= static_cast<const Nif::NiParticleColorModifier*>(modifier.getPtr()); = static_cast<const Nif::NiParticleColorModifier*>(modifier.getPtr());
@ -1210,29 +1217,29 @@ namespace NifOsg
const Nif::NiColorData* clrdata = cl->mData.getPtr(); const Nif::NiColorData* clrdata = cl->mData.getPtr();
program->addOperator(new ParticleColorAffector(clrdata)); program->addOperator(new ParticleColorAffector(clrdata));
} }
else if (modifier->recType == Nif::RC_NiParticleRotation) else if (modifier->mRecordType == Nif::RC_NiParticleRotation)
{ {
// unused // unused
} }
else else
Log(Debug::Info) << "Unhandled particle modifier " << modifier->recName << " in " << mFilename; Log(Debug::Info) << "Unhandled particle modifier " << modifier->mRecordName << " in " << mFilename;
} }
for (; !collider.empty(); collider = collider->mNext) for (; !collider.empty(); collider = collider->mNext)
{ {
if (collider->recType == Nif::RC_NiPlanarCollider) if (collider->mRecordType == Nif::RC_NiPlanarCollider)
{ {
const Nif::NiPlanarCollider* planarcollider const Nif::NiPlanarCollider* planarcollider
= static_cast<const Nif::NiPlanarCollider*>(collider.getPtr()); = static_cast<const Nif::NiPlanarCollider*>(collider.getPtr());
program->addOperator(new PlanarCollider(planarcollider)); program->addOperator(new PlanarCollider(planarcollider));
} }
else if (collider->recType == Nif::RC_NiSphericalCollider) else if (collider->mRecordType == Nif::RC_NiSphericalCollider)
{ {
const Nif::NiSphericalCollider* sphericalcollider const Nif::NiSphericalCollider* sphericalcollider
= static_cast<const Nif::NiSphericalCollider*>(collider.getPtr()); = static_cast<const Nif::NiSphericalCollider*>(collider.getPtr());
program->addOperator(new SphericalCollider(sphericalcollider)); program->addOperator(new SphericalCollider(sphericalcollider));
} }
else else
Log(Debug::Info) << "Unhandled particle collider " << collider->recName << " in " << mFilename; Log(Debug::Info) << "Unhandled particle collider " << collider->mRecordName << " in " << mFilename;
} }
} }
@ -1297,7 +1304,7 @@ namespace NifOsg
static osg::ref_ptr<Emitter> handleParticleEmitter(const Nif::NiParticleSystemController* partctrl) static osg::ref_ptr<Emitter> handleParticleEmitter(const Nif::NiParticleSystemController* partctrl)
{ {
std::vector<int> targets; std::vector<int> targets;
if (partctrl->recType == Nif::RC_NiBSPArrayController && !partctrl->emitAtVertex()) if (partctrl->mRecordType == Nif::RC_NiBSPArrayController && !partctrl->emitAtVertex())
{ {
getAllNiNodes(partctrl->mEmitter.getPtr(), targets); getAllNiNodes(partctrl->mEmitter.getPtr(), targets);
} }
@ -1322,9 +1329,9 @@ namespace NifOsg
emitter->setShooter(shooter); emitter->setShooter(shooter);
emitter->setFlags(partctrl->mFlags); emitter->setFlags(partctrl->mFlags);
if (partctrl->recType == Nif::RC_NiBSPArrayController && partctrl->emitAtVertex()) if (partctrl->mRecordType == Nif::RC_NiBSPArrayController && partctrl->emitAtVertex())
{ {
emitter->setGeometryEmitterTarget(partctrl->mEmitter->recIndex); emitter->setGeometryEmitterTarget(partctrl->mEmitter->mRecordIndex);
} }
else else
{ {
@ -1376,8 +1383,8 @@ namespace NifOsg
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
if (ctrl->recType == Nif::RC_NiParticleSystemController if (ctrl->mRecordType == Nif::RC_NiParticleSystemController
|| ctrl->recType == Nif::RC_NiBSPArrayController) || ctrl->mRecordType == Nif::RC_NiBSPArrayController)
partctrl = static_cast<Nif::NiParticleSystemController*>(ctrl.getPtr()); partctrl = static_cast<Nif::NiParticleSystemController*>(ctrl.getPtr());
} }
if (!partctrl) if (!partctrl)
@ -1415,7 +1422,7 @@ namespace NifOsg
// The emitter node may not actually be handled yet, so let's delay attaching the emitter to a later // The emitter node may not actually be handled yet, so let's delay attaching the emitter to a later
// moment. If the emitter node is placed later than the particle node, it'll have a single frame delay // moment. If the emitter node is placed later than the particle node, it'll have a single frame delay
// in particle processing. But that shouldn't be a game-breaking issue. // in particle processing. But that shouldn't be a game-breaking issue.
mEmitterQueue.emplace_back(partctrl->mEmitter->recIndex, emitter); mEmitterQueue.emplace_back(partctrl->mEmitter->mRecordIndex, emitter);
osg::ref_ptr<ParticleSystemController> callback(new ParticleSystemController(partctrl)); osg::ref_ptr<ParticleSystemController> callback(new ParticleSystemController(partctrl));
setupController(partctrl, callback, animflags); setupController(partctrl, callback, animflags);
@ -1505,7 +1512,7 @@ namespace NifOsg
const Nif::NiGeometryData* niGeometryData = niGeometry->mData.getPtr(); const Nif::NiGeometryData* niGeometryData = niGeometry->mData.getPtr();
if (!hasPartitions) if (!hasPartitions)
{ {
if (niGeometry->recType == Nif::RC_NiTriShape || nifNode->recType == Nif::RC_BSLODTriShape) if (niGeometry->mRecordType == Nif::RC_NiTriShape || nifNode->mRecordType == Nif::RC_BSLODTriShape)
{ {
auto data = static_cast<const Nif::NiTriShapeData*>(niGeometryData); auto data = static_cast<const Nif::NiTriShapeData*>(niGeometryData);
const std::vector<unsigned short>& triangles = data->mTriangles; const std::vector<unsigned short>& triangles = data->mTriangles;
@ -1514,7 +1521,7 @@ namespace NifOsg
geometry->addPrimitiveSet(new osg::DrawElementsUShort( geometry->addPrimitiveSet(new osg::DrawElementsUShort(
osg::PrimitiveSet::TRIANGLES, static_cast<unsigned>(triangles.size()), triangles.data())); osg::PrimitiveSet::TRIANGLES, static_cast<unsigned>(triangles.size()), triangles.data()));
} }
else if (niGeometry->recType == Nif::RC_NiTriStrips) else if (niGeometry->mRecordType == Nif::RC_NiTriStrips)
{ {
auto data = static_cast<const Nif::NiTriStripsData*>(niGeometryData); auto data = static_cast<const Nif::NiTriStripsData*>(niGeometryData);
bool hasGeometry = false; bool hasGeometry = false;
@ -1529,7 +1536,7 @@ namespace NifOsg
if (!hasGeometry) if (!hasGeometry)
return; return;
} }
else if (niGeometry->recType == Nif::RC_NiLines) else if (niGeometry->mRecordType == Nif::RC_NiLines)
{ {
auto data = static_cast<const Nif::NiLinesData*>(niGeometryData); auto data = static_cast<const Nif::NiLinesData*>(niGeometryData);
const auto& line = data->mLines; const auto& line = data->mLines;
@ -1588,7 +1595,7 @@ namespace NifOsg
SceneUtil::CompositeStateSetUpdater* composite, const std::vector<unsigned int>& boundTextures, SceneUtil::CompositeStateSetUpdater* composite, const std::vector<unsigned int>& boundTextures,
int animflags) int animflags)
{ {
assert(isTypeNiGeometry(nifNode->recType)); assert(isTypeNiGeometry(nifNode->mRecordType));
osg::ref_ptr<osg::Geometry> geom(new osg::Geometry); osg::ref_ptr<osg::Geometry> geom(new osg::Geometry);
handleNiGeometryData(nifNode, parent, geom, parentNode, composite, boundTextures, animflags); handleNiGeometryData(nifNode, parent, geom, parentNode, composite, boundTextures, animflags);
@ -1633,7 +1640,7 @@ namespace NifOsg
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
if (ctrl->recType == Nif::RC_NiGeomMorpherController) if (ctrl->mRecordType == Nif::RC_NiGeomMorpherController)
{ {
if (!niGeometry->mSkin.empty()) if (!niGeometry->mSkin.empty())
continue; continue;
@ -1672,7 +1679,7 @@ namespace NifOsg
SceneUtil::CompositeStateSetUpdater* composite, const std::vector<unsigned int>& boundTextures, SceneUtil::CompositeStateSetUpdater* composite, const std::vector<unsigned int>& boundTextures,
int animflags) int animflags)
{ {
assert(isTypeBSGeometry(nifNode->recType)); assert(isTypeBSGeometry(nifNode->mRecordType));
auto bsTriShape = static_cast<const Nif::BSTriShape*>(nifNode); auto bsTriShape = static_cast<const Nif::BSTriShape*>(nifNode);
const std::vector<unsigned short>& triangles = bsTriShape->mTriangles; const std::vector<unsigned short>& triangles = bsTriShape->mTriangles;
@ -1758,7 +1765,7 @@ namespace NifOsg
// This is the skinning data Fallout 4 provides // This is the skinning data Fallout 4 provides
// TODO: support Skyrim SE skinning data // TODO: support Skyrim SE skinning data
if (!bsTriShape->mSkin.empty() && bsTriShape->mSkin->recType == Nif::RC_BSSkinInstance if (!bsTriShape->mSkin.empty() && bsTriShape->mSkin->mRecordType == Nif::RC_BSSkinInstance
&& bsTriShape->mVertDesc.mFlags & Nif::BSVertexDesc::VertexAttribute::Skinned) && bsTriShape->mVertDesc.mFlags & Nif::BSVertexDesc::VertexAttribute::Skinned)
{ {
osg::ref_ptr<SceneUtil::RigGeometry> rig(new SceneUtil::RigGeometry); osg::ref_ptr<SceneUtil::RigGeometry> rig(new SceneUtil::RigGeometry);
@ -2470,7 +2477,7 @@ namespace NifOsg
SceneUtil::CompositeStateSetUpdater* composite, std::vector<unsigned int>& boundTextures, int animflags, SceneUtil::CompositeStateSetUpdater* composite, std::vector<unsigned int>& boundTextures, int animflags,
bool hasStencilProperty) bool hasStencilProperty)
{ {
switch (property->recType) switch (property->mRecordType)
{ {
case Nif::RC_NiStencilProperty: case Nif::RC_NiStencilProperty:
{ {
@ -2705,7 +2712,7 @@ namespace NifOsg
break; break;
} }
default: default:
Log(Debug::Info) << "Unhandled " << property->recName << " in " << mFilename; Log(Debug::Info) << "Unhandled " << property->mRecordName << " in " << mFilename;
break; break;
} }
} }
@ -2758,7 +2765,7 @@ namespace NifOsg
for (const Nif::NiProperty* property : properties) for (const Nif::NiProperty* property : properties)
{ {
switch (property->recType) switch (property->mRecordType)
{ {
case Nif::RC_NiSpecularProperty: case Nif::RC_NiSpecularProperty:
{ {
@ -2986,7 +2993,8 @@ namespace NifOsg
case Nif::NiSortAdjustNode::SortingMode::Inherit: case Nif::NiSortAdjustNode::SortingMode::Inherit:
{ {
if (mLastAppliedNoInheritSorter) if (mLastAppliedNoInheritSorter)
assignBin(mLastAppliedNoInheritSorter->mMode, mLastAppliedNoInheritSorter->mSubSorter->recType); assignBin(
mLastAppliedNoInheritSorter->mMode, mLastAppliedNoInheritSorter->mSubSorter->mRecordType);
else else
assignBin(mPushedSorter->mMode, Nif::RC_NiAlphaAccumulator); assignBin(mPushedSorter->mMode, Nif::RC_NiAlphaAccumulator);
break; break;
@ -2998,7 +3006,7 @@ namespace NifOsg
} }
case Nif::NiSortAdjustNode::SortingMode::Subsort: case Nif::NiSortAdjustNode::SortingMode::Subsort:
{ {
assignBin(mPushedSorter->mMode, mPushedSorter->mSubSorter->recType); assignBin(mPushedSorter->mMode, mPushedSorter->mSubSorter->mRecordType);
break; break;
} }
} }