1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 08:39:45 +00:00

Use a typedef to avoid conditional compiling

This commit is contained in:
scrawl 2015-12-01 16:18:19 +01:00
parent c912310c52
commit c9d710f334

View file

@ -47,16 +47,14 @@ namespace NifOsg
class ValueInterpolator class ValueInterpolator
{ {
public: public:
typedef typename MapT::ValueType ValueT;
ValueInterpolator() ValueInterpolator()
: mDefaultVal(typename MapT::ValueType()) : mDefaultVal(ValueT())
{ {
} }
#ifdef _MSC_VER ValueInterpolator(boost::shared_ptr<const MapT> keys, ValueT defaultVal = ValueT())
ValueInterpolator(boost::shared_ptr<const MapT> keys, typename MapT::ValueType defaultVal = MapT::ValueType())
#else
ValueInterpolator(boost::shared_ptr<const MapT> keys, typename MapT::ValueType defaultVal = typename MapT::ValueType())
#endif
: mKeys(keys) : mKeys(keys)
, mDefaultVal(defaultVal) , mDefaultVal(defaultVal)
{ {
@ -67,7 +65,7 @@ namespace NifOsg
} }
} }
typename MapT::ValueType interpKey(float time) const ValueT interpKey(float time) const
{ {
if (empty()) if (empty())
return mDefaultVal; return mDefaultVal;
@ -130,7 +128,7 @@ namespace NifOsg
boost::shared_ptr<const MapT> mKeys; boost::shared_ptr<const MapT> mKeys;
typename MapT::ValueType mDefaultVal; ValueT mDefaultVal;
}; };
struct LerpFunc struct LerpFunc