mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-02 04:41:31 +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 <components/sceneutil/statesetupdater.hpp>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
#include <osg/Texture2D>
|
#include <osg/Texture2D>
|
||||||
|
|
||||||
|
@ -58,8 +59,38 @@ namespace NifOsg
|
||||||
using ValueT = typename MapT::ValueType;
|
using ValueT = typename MapT::ValueType;
|
||||||
|
|
||||||
ValueInterpolator() = default;
|
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())
|
ValueInterpolator(std::shared_ptr<const MapT> keys, ValueT defaultVal = ValueT())
|
||||||
: mKeys(keys)
|
: mKeys(keys)
|
||||||
|
@ -163,34 +194,6 @@ namespace NifOsg
|
||||||
using Vec3Interpolator = ValueInterpolator<Nif::Vector3KeyMap>;
|
using Vec3Interpolator = ValueInterpolator<Nif::Vector3KeyMap>;
|
||||||
using Vec4Interpolator = ValueInterpolator<Nif::Vector4KeyMap>;
|
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
|
class ControllerFunction : public SceneUtil::ControllerFunction
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue