mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-06 23:41:35 +00:00
Rename Property->NiProperty
This commit is contained in:
parent
defe5ba5e7
commit
1b93e646b8
6 changed files with 37 additions and 37 deletions
|
@ -190,7 +190,7 @@ osg::Group {
|
||||||
property.mTextureSet = nullptr;
|
property.mTextureSet = nullptr;
|
||||||
property.mController = nullptr;
|
property.mController = nullptr;
|
||||||
property.mType = GetParam().mShaderType;
|
property.mType = GetParam().mShaderType;
|
||||||
node.mProperties.push_back(Nif::RecordPtrT<Nif::Property>(&property));
|
node.mProperties.push_back(Nif::RecordPtrT<Nif::NiProperty>(&property));
|
||||||
Nif::NIFFile file("test.nif");
|
Nif::NIFFile file("test.nif");
|
||||||
file.mRoots.push_back(&node);
|
file.mRoots.push_back(&node);
|
||||||
auto result = Loader::load(file, &mImageManager);
|
auto result = Loader::load(file, &mImageManager);
|
||||||
|
@ -218,7 +218,7 @@ osg::Group {
|
||||||
property.mTextureSet = nullptr;
|
property.mTextureSet = nullptr;
|
||||||
property.mController = nullptr;
|
property.mController = nullptr;
|
||||||
property.mType = GetParam().mShaderType;
|
property.mType = GetParam().mShaderType;
|
||||||
node.mProperties.push_back(Nif::RecordPtrT<Nif::Property>(&property));
|
node.mProperties.push_back(Nif::RecordPtrT<Nif::NiProperty>(&property));
|
||||||
Nif::NIFFile file("test.nif");
|
Nif::NIFFile file("test.nif");
|
||||||
file.mRoots.push_back(&node);
|
file.mRoots.push_back(&node);
|
||||||
auto result = Loader::load(file, &mImageManager);
|
auto result = Loader::load(file, &mImageManager);
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace Nif
|
||||||
uint32_t mFlags;
|
uint32_t mFlags;
|
||||||
NiTransform mTransform;
|
NiTransform mTransform;
|
||||||
osg::Vec3f mVelocity;
|
osg::Vec3f mVelocity;
|
||||||
PropertyList mProperties;
|
NiPropertyList mProperties;
|
||||||
BoundingVolume mBounds;
|
BoundingVolume mBounds;
|
||||||
NiCollisionObjectPtr mCollision;
|
NiCollisionObjectPtr mCollision;
|
||||||
// Parent nodes for the node. Only types derived from NiNode can be parents.
|
// Parent nodes for the node. Only types derived from NiNode can be parents.
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Nif
|
||||||
|
|
||||||
void NiTexturingProperty::read(NIFStream* nif)
|
void NiTexturingProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD
|
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD
|
||||||
|| nif->getVersion() >= NIFStream::generateVersion(20, 1, 0, 2))
|
|| nif->getVersion() >= NIFStream::generateVersion(20, 1, 0, 2))
|
||||||
|
@ -102,7 +102,7 @@ namespace Nif
|
||||||
|
|
||||||
void NiTexturingProperty::post(Reader& nif)
|
void NiTexturingProperty::post(Reader& nif)
|
||||||
{
|
{
|
||||||
Property::post(nif);
|
NiProperty::post(nif);
|
||||||
|
|
||||||
for (Texture& tex : mTextures)
|
for (Texture& tex : mTextures)
|
||||||
tex.post(nif);
|
tex.post(nif);
|
||||||
|
@ -425,7 +425,7 @@ namespace Nif
|
||||||
|
|
||||||
void NiAlphaProperty::read(NIFStream* nif)
|
void NiAlphaProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
nif->read(mThreshold);
|
nif->read(mThreshold);
|
||||||
|
@ -433,14 +433,14 @@ namespace Nif
|
||||||
|
|
||||||
void NiDitherProperty::read(NIFStream* nif)
|
void NiDitherProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NiFogProperty::read(NIFStream* nif)
|
void NiFogProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
nif->read(mFogDepth);
|
nif->read(mFogDepth);
|
||||||
|
@ -449,7 +449,7 @@ namespace Nif
|
||||||
|
|
||||||
void NiMaterialProperty::read(NIFStream* nif)
|
void NiMaterialProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD)
|
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD)
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
|
@ -468,7 +468,7 @@ namespace Nif
|
||||||
|
|
||||||
void NiShadeProperty::read(NIFStream* nif)
|
void NiShadeProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
if (nif->getBethVersion() <= NIFFile::BethVersion::BETHVER_FO3)
|
if (nif->getBethVersion() <= NIFFile::BethVersion::BETHVER_FO3)
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
|
@ -476,14 +476,14 @@ namespace Nif
|
||||||
|
|
||||||
void NiSpecularProperty::read(NIFStream* nif)
|
void NiSpecularProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
mEnable = nif->get<uint16_t>() & 1;
|
mEnable = nif->get<uint16_t>() & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NiStencilProperty::read(NIFStream* nif)
|
void NiStencilProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB)
|
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB)
|
||||||
{
|
{
|
||||||
|
@ -514,7 +514,7 @@ namespace Nif
|
||||||
|
|
||||||
void NiVertexColorProperty::read(NIFStream* nif)
|
void NiVertexColorProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB)
|
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB)
|
||||||
|
@ -531,14 +531,14 @@ namespace Nif
|
||||||
|
|
||||||
void NiWireframeProperty::read(NIFStream* nif)
|
void NiWireframeProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
mEnable = nif->get<uint16_t>() & 1;
|
mEnable = nif->get<uint16_t>() & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NiZBufferProperty::read(NIFStream* nif)
|
void NiZBufferProperty::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
Property::read(nif);
|
NiProperty::read(nif);
|
||||||
|
|
||||||
nif->read(mFlags);
|
nif->read(mFlags);
|
||||||
if (nif->getVersion() >= NIFStream::generateVersion(4, 1, 0, 12)
|
if (nif->getVersion() >= NIFStream::generateVersion(4, 1, 0, 12)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
namespace Nif
|
namespace Nif
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Property : NiObjectNET
|
struct NiProperty : NiObjectNET
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace Nif
|
||||||
void read(NIFStream* nif);
|
void read(NIFStream* nif);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiTexturingProperty : Property
|
struct NiTexturingProperty : NiProperty
|
||||||
{
|
{
|
||||||
enum class ApplyMode : uint32_t
|
enum class ApplyMode : uint32_t
|
||||||
{
|
{
|
||||||
|
@ -86,7 +86,7 @@ namespace Nif
|
||||||
void post(Reader& nif) override;
|
void post(Reader& nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiShadeProperty : Property
|
struct NiShadeProperty : NiProperty
|
||||||
{
|
{
|
||||||
uint16_t mFlags{ 0u };
|
uint16_t mFlags{ 0u };
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ namespace Nif
|
||||||
bool treeAnim() const { return mShaderFlags2 & BSLSFlag2_TreeAnim; }
|
bool treeAnim() const { return mShaderFlags2 & BSLSFlag2_TreeAnim; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiAlphaProperty : Property
|
struct NiAlphaProperty : NiProperty
|
||||||
{
|
{
|
||||||
enum Flags
|
enum Flags
|
||||||
{
|
{
|
||||||
|
@ -376,14 +376,14 @@ namespace Nif
|
||||||
int alphaTestMode() const { return (mFlags >> 10) & 0x7; }
|
int alphaTestMode() const { return (mFlags >> 10) & 0x7; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiDitherProperty : Property
|
struct NiDitherProperty : NiProperty
|
||||||
{
|
{
|
||||||
uint16_t mFlags;
|
uint16_t mFlags;
|
||||||
|
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiFogProperty : Property
|
struct NiFogProperty : NiProperty
|
||||||
{
|
{
|
||||||
uint16_t mFlags;
|
uint16_t mFlags;
|
||||||
float mFogDepth;
|
float mFogDepth;
|
||||||
|
@ -392,7 +392,7 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiMaterialProperty : Property
|
struct NiMaterialProperty : NiProperty
|
||||||
{
|
{
|
||||||
uint16_t mFlags{ 0u };
|
uint16_t mFlags{ 0u };
|
||||||
osg::Vec3f mAmbient{ 1.f, 1.f, 1.f };
|
osg::Vec3f mAmbient{ 1.f, 1.f, 1.f };
|
||||||
|
@ -406,14 +406,14 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiSpecularProperty : Property
|
struct NiSpecularProperty : NiProperty
|
||||||
{
|
{
|
||||||
bool mEnable;
|
bool mEnable;
|
||||||
|
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiStencilProperty : Property
|
struct NiStencilProperty : NiProperty
|
||||||
{
|
{
|
||||||
enum class TestFunc : uint32_t
|
enum class TestFunc : uint32_t
|
||||||
{
|
{
|
||||||
|
@ -458,7 +458,7 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiVertexColorProperty : Property
|
struct NiVertexColorProperty : NiProperty
|
||||||
{
|
{
|
||||||
enum class VertexMode : uint32_t
|
enum class VertexMode : uint32_t
|
||||||
{
|
{
|
||||||
|
@ -480,14 +480,14 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiWireframeProperty : Property
|
struct NiWireframeProperty : NiProperty
|
||||||
{
|
{
|
||||||
bool mEnable;
|
bool mEnable;
|
||||||
|
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NiZBufferProperty : Property
|
struct NiZBufferProperty : NiProperty
|
||||||
{
|
{
|
||||||
uint16_t mFlags;
|
uint16_t mFlags;
|
||||||
uint32_t mTestFunction;
|
uint32_t mTestFunction;
|
||||||
|
|
|
@ -112,7 +112,7 @@ namespace Nif
|
||||||
|
|
||||||
struct NiAVObject;
|
struct NiAVObject;
|
||||||
struct Extra;
|
struct Extra;
|
||||||
struct Property;
|
struct NiProperty;
|
||||||
struct NiUVData;
|
struct NiUVData;
|
||||||
struct NiPosData;
|
struct NiPosData;
|
||||||
struct NiVisData;
|
struct NiVisData;
|
||||||
|
@ -191,7 +191,7 @@ namespace Nif
|
||||||
using BSMultiBoundDataPtr = RecordPtrT<BSMultiBoundData>;
|
using BSMultiBoundDataPtr = RecordPtrT<BSMultiBoundData>;
|
||||||
|
|
||||||
using NiAVObjectList = RecordListT<NiAVObject>;
|
using NiAVObjectList = RecordListT<NiAVObject>;
|
||||||
using PropertyList = RecordListT<Property>;
|
using NiPropertyList = RecordListT<NiProperty>;
|
||||||
using ExtraList = RecordListT<Extra>;
|
using ExtraList = RecordListT<Extra>;
|
||||||
using NiSourceTextureList = RecordListT<NiSourceTexture>;
|
using NiSourceTextureList = RecordListT<NiSourceTexture>;
|
||||||
using NiInterpolatorList = RecordListT<NiInterpolator>;
|
using NiInterpolatorList = RecordListT<NiInterpolator>;
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace
|
||||||
// Collect all properties affecting the given drawable that should be handled on drawable basis rather than on the
|
// Collect all properties affecting the given drawable that should be handled on drawable basis rather than on the
|
||||||
// node hierarchy above it.
|
// node hierarchy above it.
|
||||||
void collectDrawableProperties(
|
void collectDrawableProperties(
|
||||||
const Nif::NiAVObject* nifNode, const Nif::Parent* parent, std::vector<const Nif::Property*>& out)
|
const Nif::NiAVObject* nifNode, const Nif::Parent* parent, std::vector<const Nif::NiProperty*>& out)
|
||||||
{
|
{
|
||||||
if (parent != nullptr)
|
if (parent != nullptr)
|
||||||
collectDrawableProperties(&parent->mNiNode, parent->mParent, out);
|
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)
|
SceneUtil::CompositeStateSetUpdater* composite, int animflags, const osg::Material* baseMaterial)
|
||||||
{
|
{
|
||||||
for (Nif::NiTimeControllerPtr ctrl = materialProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext)
|
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)
|
Resource::ImageManager* imageManager, osg::StateSet* stateset, int animflags)
|
||||||
{
|
{
|
||||||
for (Nif::NiTimeControllerPtr ctrl = texProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext)
|
for (Nif::NiTimeControllerPtr ctrl = texProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext)
|
||||||
|
@ -1316,7 +1316,7 @@ namespace NifOsg
|
||||||
// localToWorldMatrix for transforming to particle space
|
// localToWorldMatrix for transforming to particle space
|
||||||
handleParticlePrograms(partctrl->mModifier, partctrl->mCollider, parentNode, partsys.get(), rf);
|
handleParticlePrograms(partctrl->mModifier, partctrl->mCollider, parentNode, partsys.get(), rf);
|
||||||
|
|
||||||
std::vector<const Nif::Property*> drawableProps;
|
std::vector<const Nif::NiProperty*> drawableProps;
|
||||||
collectDrawableProperties(nifNode, parent, drawableProps);
|
collectDrawableProperties(nifNode, parent, drawableProps);
|
||||||
applyDrawableProperties(parentNode, drawableProps, composite, true, animflags);
|
applyDrawableProperties(parentNode, drawableProps, composite, true, animflags);
|
||||||
|
|
||||||
|
@ -1462,7 +1462,7 @@ namespace NifOsg
|
||||||
// - if there are no vertex colors, we need to disable colorMode.
|
// - 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
|
// - there are 3 "overlapping" nif properties that all affect the osg::Material, handling them
|
||||||
// above the actual renderable would be tedious.
|
// above the actual renderable would be tedious.
|
||||||
std::vector<const Nif::Property*> drawableProps;
|
std::vector<const Nif::NiProperty*> drawableProps;
|
||||||
collectDrawableProperties(nifNode, parent, drawableProps);
|
collectDrawableProperties(nifNode, parent, drawableProps);
|
||||||
applyDrawableProperties(parentNode, drawableProps, composite, !niGeometryData->mColors.empty(), animflags);
|
applyDrawableProperties(parentNode, drawableProps, composite, !niGeometryData->mColors.empty(), animflags);
|
||||||
}
|
}
|
||||||
|
@ -2107,7 +2107,7 @@ namespace NifOsg
|
||||||
return "bs/default";
|
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,
|
SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* imageManager,
|
||||||
std::vector<unsigned int>& boundTextures, int animflags, bool hasStencilProperty)
|
std::vector<unsigned int>& boundTextures, int animflags, bool hasStencilProperty)
|
||||||
{
|
{
|
||||||
|
@ -2366,7 +2366,7 @@ namespace NifOsg
|
||||||
return *found;
|
return *found;
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyDrawableProperties(osg::Node* node, const std::vector<const Nif::Property*>& properties,
|
void applyDrawableProperties(osg::Node* node, const std::vector<const Nif::NiProperty*>& properties,
|
||||||
SceneUtil::CompositeStateSetUpdater* composite, bool hasVertexColors, int animflags)
|
SceneUtil::CompositeStateSetUpdater* composite, bool hasVertexColors, int animflags)
|
||||||
{
|
{
|
||||||
// Specular lighting is enabled by default, but there's a quirk...
|
// Specular lighting is enabled by default, but there's a quirk...
|
||||||
|
@ -2391,7 +2391,7 @@ namespace NifOsg
|
||||||
float emissiveMult = 1.f;
|
float emissiveMult = 1.f;
|
||||||
float specStrength = 1.f;
|
float specStrength = 1.f;
|
||||||
|
|
||||||
for (const Nif::Property* property : properties)
|
for (const Nif::NiProperty* property : properties)
|
||||||
{
|
{
|
||||||
switch (property->recType)
|
switch (property->recType)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue