1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

check ValueTs

This commit is contained in:
Evil Eye 2020-11-13 16:41:45 +01:00
parent d8897c4509
commit 94c89e6d5e

View File

@ -60,11 +60,20 @@ namespace NifOsg
ValueInterpolator() = default;
template<class T = MapT>
ValueInterpolator(typename std::enable_if_t<
std::is_same<T, Nif::FloatKeyMap>::value,
const Nif::NiFloatInterpolator
> * interpolator) : mDefaultVal(interpolator->defaultVal)
template<
class T,
typename = std::enable_if_t<
std::conjunction_v<
std::disjunction<
std::is_same<ValueT, float>,
std::is_same<ValueT, osg::Vec3f>
>,
std::is_same<decltype(T::defaultVal), ValueT>
>,
T
>
>
ValueInterpolator(const T* interpolator) : mDefaultVal(interpolator->defaultVal)
{
if (interpolator->data.empty())
return;
@ -76,22 +85,6 @@ namespace NifOsg
}
};
template<class T = MapT>
ValueInterpolator(typename std::enable_if_t<
std::is_same<T, Nif::Vector3KeyMap>::value,
const Nif::NiPoint3Interpolator
> * interpolator) : mDefaultVal(interpolator->defaultVal)
{
if (interpolator->data.empty())
return;
mKeys = interpolator->data->mKeyList;
if (mKeys)
{
mLastLowKey = mKeys->mKeys.end();
mLastHighKey = mKeys->mKeys.end();
}
}
ValueInterpolator(std::shared_ptr<const MapT> keys, ValueT defaultVal = ValueT())
: mKeys(keys)
, mDefaultVal(defaultVal)