Read BSShaderTextureSet and NiColorInterpolator

Accept boolean-based and 4D vector-based NiInterpolators in ValueInterpolator constructor
pull/593/head
Alexei Dobrohotov 4 years ago
parent 2373f07168
commit 1c83e4936d

@ -47,6 +47,11 @@ namespace Nif
data.post(nif);
}
void BSShaderTextureSet::read(NIFStream *nif)
{
nif->getSizedStrings(textures, nif->getUInt());
}
void NiParticleModifier::read(NIFStream *nif)
{
next.read(nif);

@ -66,6 +66,24 @@ public:
void post(NIFFile *nif) override;
};
struct BSShaderTextureSet : public Record
{
enum TextureType
{
TextureType_Base = 0,
TextureType_Normal = 1,
TextureType_Glow = 2,
TextureType_Parallax = 3,
TextureType_Env = 4,
TextureType_EnvMask = 5,
TextureType_Subsurface = 6,
TextureType_BackLighting = 7
};
std::vector<std::string> textures;
void read(NIFStream *nif) override;
};
struct NiParticleModifier : public Record
{
NiParticleModifierPtr next;

@ -325,4 +325,15 @@ namespace Nif
data.post(nif);
}
void NiColorInterpolator::read(NIFStream *nif)
{
defaultVal = nif->getVector4();
data.read(nif);
}
void NiColorInterpolator::post(NIFFile *nif)
{
data.post(nif);
}
}

@ -230,5 +230,13 @@ struct NiTransformInterpolator : public Interpolator
void post(NIFFile *nif) override;
};
struct NiColorInterpolator : public Interpolator
{
osg::Vec4f defaultVal;
NiColorDataPtr data;
void read(NIFStream *nif) override;
void post(NIFFile *nif) override;
};
} // Namespace
#endif

@ -129,6 +129,8 @@ static std::map<std::string,RecordFactoryEntry> makeFactory()
factory["NiPoint3Interpolator"] = {&construct <NiPoint3Interpolator> , RC_NiPoint3Interpolator };
factory["NiTransformController"] = {&construct <NiKeyframeController> , RC_NiKeyframeController };
factory["NiTransformInterpolator"] = {&construct <NiTransformInterpolator> , RC_NiTransformInterpolator };
factory["NiColorInterpolator"] = {&construct <NiColorInterpolator> , RC_NiColorInterpolator };
factory["BSShaderTextureSet"] = {&construct <BSShaderTextureSet> , RC_BSShaderTextureSet };
return factory;
}

@ -118,7 +118,9 @@ enum RecordType
RC_NiFloatInterpolator,
RC_NiPoint3Interpolator,
RC_NiBoolInterpolator,
RC_NiTransformInterpolator
RC_NiTransformInterpolator,
RC_NiColorInterpolator,
RC_BSShaderTextureSet
};
/// Base class for all records

@ -147,6 +147,7 @@ struct NiSkinPartition;
struct NiFloatInterpolator;
struct NiPoint3Interpolator;
struct NiTransformInterpolator;
struct BSShaderTextureSet;
using NodePtr = RecordPtrT<Node>;
using ExtraPtr = RecordPtrT<Extra>;
@ -174,6 +175,7 @@ using NiSkinPartitionPtr = RecordPtrT<NiSkinPartition>;
using NiFloatInterpolatorPtr = RecordPtrT<NiFloatInterpolator>;
using NiPoint3InterpolatorPtr = RecordPtrT<NiPoint3Interpolator>;
using NiTransformInterpolatorPtr = RecordPtrT<NiTransformInterpolator>;
using BSShaderTextureSetPtr = RecordPtrT<BSShaderTextureSet>;
using NodeList = RecordListT<Node>;
using PropertyList = RecordListT<Property>;

@ -66,7 +66,9 @@ namespace NifOsg
std::conjunction_v<
std::disjunction<
std::is_same<ValueT, float>,
std::is_same<ValueT, osg::Vec3f>
std::is_same<ValueT, osg::Vec3f>,
std::is_same<ValueT, bool>,
std::is_same<ValueT, osg::Vec4f>
>,
std::is_same<decltype(T::defaultVal), ValueT>
>,

Loading…
Cancel
Save