1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 09:45:40 +00:00

Fix gcc build error: call of overloaded ‘lerp(const float&, const float&, const float&)’ is ambiguous

/home/elsid/dev/openmw/apps/openmw/mwworld/weather.cpp: In member function ‘void MWWorld::WeatherManager::calculateTransitionResult(float, float)’:
/home/elsid/dev/openmw/apps/openmw/mwworld/weather.cpp:1223:33: error: call of overloaded ‘lerp(const float&, const float&, const float&)’ is ambiguous
 1223 |         mResult.mFogDepth = lerp(current.mFogDepth, other.mFogDepth, factor);
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/elsid/dev/OpenSceneGraph/build/gcc/release/install/include/osg/Math:17,
                 from /home/elsid/dev/OpenSceneGraph/build/gcc/release/install/include/osg/Vec2f:17,
                 from /home/elsid/dev/OpenSceneGraph/build/gcc/release/install/include/osg/Vec3f:17,
                 from /home/elsid/dev/openmw/components/esm/defs.hpp:8,
                 from /home/elsid/dev/openmw/components/esm/records.hpp:4,
                 from /home/elsid/dev/openmw/apps/openmw/mwworld/esmstore.hpp:10,
                 from /home/elsid/dev/openmw/build/gcc/fast/apps/openmw/CMakeFiles/openmw.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/c++/12.1.0/cmath:1919:3: note: candidate: ‘constexpr long double std::lerp(long double, long double, long double)’
 1919 |   lerp(long double __a, long double __b, long double __t) noexcept
      |   ^~~~
/usr/include/c++/12.1.0/cmath:1915:3: note: candidate: ‘constexpr double std::lerp(double, double, double)’
 1915 |   lerp(double __a, double __b, double __t) noexcept
      |   ^~~~
/usr/include/c++/12.1.0/cmath:1911:3: note: candidate: ‘constexpr float std::lerp(float, float, float)’
 1911 |   lerp(float __a, float __b, float __t) noexcept
      |   ^~~~
/home/elsid/dev/openmw/apps/openmw/mwworld/weather.cpp:31:11: note: candidate: ‘float {anonymous}::lerp(float, float, float)’
   31 |     float lerp (float x, float y, float factor)
      |           ^~~~
This commit is contained in:
elsid 2022-06-28 14:19:11 +02:00
parent 8a13cde778
commit d991b63861
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625

View file

@ -23,6 +23,8 @@
#include <cmath> #include <cmath>
namespace MWWorld
{
namespace namespace
{ {
static const int invalidWeatherID = -1; static const int invalidWeatherID = -1;
@ -53,8 +55,6 @@ namespace
} }
} }
namespace MWWorld
{
template <typename T> template <typename T>
T TimeOfDayInterpolator<T>::getValue(const float gameHour, const TimeOfDaySettings& timeSettings, const std::string& prefix) const T TimeOfDayInterpolator<T>::getValue(const float gameHour, const TimeOfDaySettings& timeSettings, const std::string& prefix) const
{ {