mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 06:09:42 +00:00
fix MSVC2017 builds
This commit is contained in:
parent
9902945c49
commit
d8d4351962
1 changed files with 33 additions and 30 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <components/sceneutil/statesetupdater.hpp>
|
||||
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
|
||||
#include <osg/Texture2D>
|
||||
|
||||
|
@ -58,8 +59,38 @@ namespace NifOsg
|
|||
using ValueT = typename MapT::ValueType;
|
||||
|
||||
ValueInterpolator() = default;
|
||||
ValueInterpolator(const Nif::NiFloatInterpolator* interpolator) = delete;
|
||||
ValueInterpolator(const Nif::NiPoint3Interpolator* interpolator) = delete;
|
||||
|
||||
template<class T = MapT>
|
||||
inline ValueInterpolator(typename std::enable_if<
|
||||
std::is_same<T, Nif::FloatKeyMap>::value,
|
||||
const Nif::NiFloatInterpolator
|
||||
>::type * interpolator) : mDefaultVal(interpolator->defaultVal)
|
||||
{
|
||||
if (interpolator->data.empty())
|
||||
return;
|
||||
mKeys = interpolator->data->mKeyList;
|
||||
if (mKeys)
|
||||
{
|
||||
mLastLowKey = mKeys->mKeys.end();
|
||||
mLastHighKey = mKeys->mKeys.end();
|
||||
}
|
||||
};
|
||||
|
||||
template<class T = MapT>
|
||||
inline ValueInterpolator(typename std::enable_if<
|
||||
std::is_same<T, Nif::Vector3KeyMap>::value,
|
||||
const Nif::NiPoint3Interpolator
|
||||
>::type * 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)
|
||||
|
@ -163,34 +194,6 @@ namespace NifOsg
|
|||
using Vec3Interpolator = ValueInterpolator<Nif::Vector3KeyMap>;
|
||||
using Vec4Interpolator = ValueInterpolator<Nif::Vector4KeyMap>;
|
||||
|
||||
template<>
|
||||
inline FloatInterpolator::ValueInterpolator(const Nif::NiFloatInterpolator* interpolator)
|
||||
: mDefaultVal(interpolator->defaultVal)
|
||||
{
|
||||
if (interpolator->data.empty())
|
||||
return;
|
||||
mKeys = interpolator->data->mKeyList;
|
||||
if (mKeys)
|
||||
{
|
||||
mLastLowKey = mKeys->mKeys.end();
|
||||
mLastHighKey = mKeys->mKeys.end();
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline Vec3Interpolator::ValueInterpolator(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();
|
||||
}
|
||||
}
|
||||
|
||||
class ControllerFunction : public SceneUtil::ControllerFunction
|
||||
{
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue