diff --git a/apps/openmw_test_suite/nifosg/testnifloader.cpp b/apps/openmw_test_suite/nifosg/testnifloader.cpp index 86a2df2135..a82fba15ca 100644 --- a/apps/openmw_test_suite/nifosg/testnifloader.cpp +++ b/apps/openmw_test_suite/nifosg/testnifloader.cpp @@ -190,7 +190,7 @@ osg::Group { property.mTextureSet = nullptr; property.mController = nullptr; property.mType = GetParam().mShaderType; - node.mProperties.push_back(Nif::RecordPtrT(&property)); + node.mProperties.push_back(Nif::RecordPtrT(&property)); Nif::NIFFile file("test.nif"); file.mRoots.push_back(&node); auto result = Loader::load(file, &mImageManager); @@ -218,7 +218,7 @@ osg::Group { property.mTextureSet = nullptr; property.mController = nullptr; property.mType = GetParam().mShaderType; - node.mProperties.push_back(Nif::RecordPtrT(&property)); + node.mProperties.push_back(Nif::RecordPtrT(&property)); Nif::NIFFile file("test.nif"); file.mRoots.push_back(&node); auto result = Loader::load(file, &mImageManager); diff --git a/components/nif/node.hpp b/components/nif/node.hpp index c87c3f6a62..0d2edad9a6 100644 --- a/components/nif/node.hpp +++ b/components/nif/node.hpp @@ -82,7 +82,7 @@ namespace Nif uint32_t mFlags; NiTransform mTransform; osg::Vec3f mVelocity; - PropertyList mProperties; + NiPropertyList mProperties; BoundingVolume mBounds; NiCollisionObjectPtr mCollision; // Parent nodes for the node. Only types derived from NiNode can be parents. diff --git a/components/nif/property.cpp b/components/nif/property.cpp index a0d6675778..2dd47e2e01 100644 --- a/components/nif/property.cpp +++ b/components/nif/property.cpp @@ -65,7 +65,7 @@ namespace Nif void NiTexturingProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD || nif->getVersion() >= NIFStream::generateVersion(20, 1, 0, 2)) @@ -102,7 +102,7 @@ namespace Nif void NiTexturingProperty::post(Reader& nif) { - Property::post(nif); + NiProperty::post(nif); for (Texture& tex : mTextures) tex.post(nif); @@ -425,7 +425,7 @@ namespace Nif void NiAlphaProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); nif->read(mFlags); nif->read(mThreshold); @@ -433,14 +433,14 @@ namespace Nif void NiDitherProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); nif->read(mFlags); } void NiFogProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); nif->read(mFlags); nif->read(mFogDepth); @@ -449,7 +449,7 @@ namespace Nif void NiMaterialProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD) nif->read(mFlags); @@ -468,7 +468,7 @@ namespace Nif void NiShadeProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); if (nif->getBethVersion() <= NIFFile::BethVersion::BETHVER_FO3) nif->read(mFlags); @@ -476,14 +476,14 @@ namespace Nif void NiSpecularProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); mEnable = nif->get() & 1; } void NiStencilProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB) { @@ -514,7 +514,7 @@ namespace Nif void NiVertexColorProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); nif->read(mFlags); if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB) @@ -531,14 +531,14 @@ namespace Nif void NiWireframeProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); mEnable = nif->get() & 1; } void NiZBufferProperty::read(NIFStream* nif) { - Property::read(nif); + NiProperty::read(nif); nif->read(mFlags); if (nif->getVersion() >= NIFStream::generateVersion(4, 1, 0, 12) diff --git a/components/nif/property.hpp b/components/nif/property.hpp index 54da082b5c..6b91d8d3d5 100644 --- a/components/nif/property.hpp +++ b/components/nif/property.hpp @@ -6,7 +6,7 @@ namespace Nif { - struct Property : NiObjectNET + struct NiProperty : NiObjectNET { }; @@ -30,7 +30,7 @@ namespace Nif void read(NIFStream* nif); }; - struct NiTexturingProperty : Property + struct NiTexturingProperty : NiProperty { enum class ApplyMode : uint32_t { @@ -86,7 +86,7 @@ namespace Nif void post(Reader& nif) override; }; - struct NiShadeProperty : Property + struct NiShadeProperty : NiProperty { uint16_t mFlags{ 0u }; @@ -325,7 +325,7 @@ namespace Nif bool treeAnim() const { return mShaderFlags2 & BSLSFlag2_TreeAnim; } }; - struct NiAlphaProperty : Property + struct NiAlphaProperty : NiProperty { enum Flags { @@ -376,14 +376,14 @@ namespace Nif int alphaTestMode() const { return (mFlags >> 10) & 0x7; } }; - struct NiDitherProperty : Property + struct NiDitherProperty : NiProperty { uint16_t mFlags; void read(NIFStream* nif) override; }; - struct NiFogProperty : Property + struct NiFogProperty : NiProperty { uint16_t mFlags; float mFogDepth; @@ -392,7 +392,7 @@ namespace Nif void read(NIFStream* nif) override; }; - struct NiMaterialProperty : Property + struct NiMaterialProperty : NiProperty { uint16_t mFlags{ 0u }; osg::Vec3f mAmbient{ 1.f, 1.f, 1.f }; @@ -406,14 +406,14 @@ namespace Nif void read(NIFStream* nif) override; }; - struct NiSpecularProperty : Property + struct NiSpecularProperty : NiProperty { bool mEnable; void read(NIFStream* nif) override; }; - struct NiStencilProperty : Property + struct NiStencilProperty : NiProperty { enum class TestFunc : uint32_t { @@ -458,7 +458,7 @@ namespace Nif void read(NIFStream* nif) override; }; - struct NiVertexColorProperty : Property + struct NiVertexColorProperty : NiProperty { enum class VertexMode : uint32_t { @@ -480,14 +480,14 @@ namespace Nif void read(NIFStream* nif) override; }; - struct NiWireframeProperty : Property + struct NiWireframeProperty : NiProperty { bool mEnable; void read(NIFStream* nif) override; }; - struct NiZBufferProperty : Property + struct NiZBufferProperty : NiProperty { uint16_t mFlags; uint32_t mTestFunction; diff --git a/components/nif/recordptr.hpp b/components/nif/recordptr.hpp index 627e59cf0d..54ebe0e9a2 100644 --- a/components/nif/recordptr.hpp +++ b/components/nif/recordptr.hpp @@ -112,7 +112,7 @@ namespace Nif struct NiAVObject; struct Extra; - struct Property; + struct NiProperty; struct NiUVData; struct NiPosData; struct NiVisData; @@ -191,7 +191,7 @@ namespace Nif using BSMultiBoundDataPtr = RecordPtrT; using NiAVObjectList = RecordListT; - using PropertyList = RecordListT; + using NiPropertyList = RecordListT; using ExtraList = RecordListT; using NiSourceTextureList = RecordListT; using NiInterpolatorList = RecordListT; diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index ef2b97dff8..f184f49625 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -103,7 +103,7 @@ namespace // Collect all properties affecting the given drawable that should be handled on drawable basis rather than on the // node hierarchy above it. void collectDrawableProperties( - const Nif::NiAVObject* nifNode, const Nif::Parent* parent, std::vector& out) + const Nif::NiAVObject* nifNode, const Nif::Parent* parent, std::vector& out) { if (parent != nullptr) collectDrawableProperties(&parent->mNiNode, parent->mParent, out); @@ -959,7 +959,7 @@ namespace NifOsg } } - void handleMaterialControllers(const Nif::Property* materialProperty, + void handleMaterialControllers(const Nif::NiProperty* materialProperty, SceneUtil::CompositeStateSetUpdater* composite, int animflags, const osg::Material* baseMaterial) { for (Nif::NiTimeControllerPtr ctrl = materialProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext) @@ -1008,7 +1008,7 @@ namespace NifOsg } } - void handleTextureControllers(const Nif::Property* texProperty, SceneUtil::CompositeStateSetUpdater* composite, + void handleTextureControllers(const Nif::NiProperty* texProperty, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* imageManager, osg::StateSet* stateset, int animflags) { for (Nif::NiTimeControllerPtr ctrl = texProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext) @@ -1316,7 +1316,7 @@ namespace NifOsg // localToWorldMatrix for transforming to particle space handleParticlePrograms(partctrl->mModifier, partctrl->mCollider, parentNode, partsys.get(), rf); - std::vector drawableProps; + std::vector drawableProps; collectDrawableProperties(nifNode, parent, drawableProps); applyDrawableProperties(parentNode, drawableProps, composite, true, animflags); @@ -1462,7 +1462,7 @@ namespace NifOsg // - if there are no vertex colors, we need to disable colorMode. // - there are 3 "overlapping" nif properties that all affect the osg::Material, handling them // above the actual renderable would be tedious. - std::vector drawableProps; + std::vector drawableProps; collectDrawableProperties(nifNode, parent, drawableProps); applyDrawableProperties(parentNode, drawableProps, composite, !niGeometryData->mColors.empty(), animflags); } @@ -2107,7 +2107,7 @@ namespace NifOsg return "bs/default"; } - void handleProperty(const Nif::Property* property, osg::Node* node, + void handleProperty(const Nif::NiProperty* property, osg::Node* node, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* imageManager, std::vector& boundTextures, int animflags, bool hasStencilProperty) { @@ -2366,7 +2366,7 @@ namespace NifOsg return *found; } - void applyDrawableProperties(osg::Node* node, const std::vector& properties, + void applyDrawableProperties(osg::Node* node, const std::vector& properties, SceneUtil::CompositeStateSetUpdater* composite, bool hasVertexColors, int animflags) { // Specular lighting is enabled by default, but there's a quirk... @@ -2391,7 +2391,7 @@ namespace NifOsg float emissiveMult = 1.f; float specStrength = 1.f; - for (const Nif::Property* property : properties) + for (const Nif::NiProperty* property : properties) { switch (property->recType) {