noise: remove constexpr from most methods

temporary measure until debug macros can be made constexpr
This commit is contained in:
Danny Robson 2015-06-30 21:56:30 +10:00
parent 1211ee0876
commit 9bfdfa3f12
18 changed files with 30 additions and 30 deletions

View File

@ -27,7 +27,7 @@ namespace util { namespace noise { namespace basis {
using seed_t = uint64_t; using seed_t = uint64_t;
constant (seed_t); constant (seed_t);
constexpr T operator() (util::point<2,T>) const; T operator() (util::point<2,T>) const;
seed_t seed; seed_t seed;
T value; T value;

View File

@ -21,7 +21,7 @@
namespace util { namespace noise { namespace basis { namespace util { namespace noise { namespace basis {
template <typename T> template <typename T>
constexpr T T
constant<T>::operator() (util::point<2,T>) const constant<T>::operator() (util::point<2,T>) const
{ {
return value; return value;

View File

@ -29,13 +29,13 @@ namespace util { namespace noise { namespace basis {
perlin (seed_t); perlin (seed_t);
range<T> bounds (void) const; range<T> bounds (void) const;
constexpr T operator() (point<2,T>) const; T operator() (point<2,T>) const;
constexpr seed_t seed (void) const; seed_t seed (void) const;
seed_t seed (seed_t); seed_t seed (seed_t);
private: private:
constexpr vector<2,T> gradient (point<2,intmax_t>) const; vector<2,T> gradient (point<2,intmax_t>) const;
seed_t m_seed; seed_t m_seed;
}; };
} } } } } }

View File

@ -43,7 +43,7 @@ namespace util { namespace noise { namespace basis {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, lerp_t<T> L> template <typename T, lerp_t<T> L>
constexpr seed_t seed_t
perlin<T,L>::seed (void) const perlin<T,L>::seed (void) const
{ {
return m_seed; return m_seed;
@ -61,7 +61,7 @@ namespace util { namespace noise { namespace basis {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, util::noise::lerp_t<T> L> template <typename T, util::noise::lerp_t<T> L>
constexpr T T
perlin<T,L>::operator() (util::point<2,T> p) const perlin<T,L>::operator() (util::point<2,T> p) const
{ {
// extract integer and fractional parts. be careful to always round down // extract integer and fractional parts. be careful to always round down
@ -99,7 +99,7 @@ namespace util { namespace noise { namespace basis {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
template <typename T, lerp_t<T> L> template <typename T, lerp_t<T> L>
constexpr vector<2,T> vector<2,T>
perlin<T,L>::gradient (point<2,intmax_t> p) const perlin<T,L>::gradient (point<2,intmax_t> p) const
{ {
using util::hash::murmur2::mix; using util::hash::murmur2::mix;

View File

@ -29,13 +29,13 @@ namespace util { namespace noise { namespace basis {
value (seed_t); value (seed_t);
range<T> bounds (void) const; range<T> bounds (void) const;
constexpr T operator() (util::point<2,T>) const; T operator() (util::point<2,T>) const;
constexpr seed_t seed (void) const; seed_t seed (void) const;
seed_t seed (seed_t); seed_t seed (seed_t);
private: private:
constexpr T generate (point<2,intmax_t>) const; T generate (point<2,intmax_t>) const;
seed_t m_seed; seed_t m_seed;
}; };

View File

@ -40,7 +40,7 @@ namespace util { namespace noise { namespace basis {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, lerp_t<T> L> template <typename T, lerp_t<T> L>
constexpr seed_t seed_t
value<T,L>::seed (void) const value<T,L>::seed (void) const
{ {
return m_seed; return m_seed;
@ -58,7 +58,7 @@ namespace util { namespace noise { namespace basis {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, util::noise::lerp_t<T> L> template <typename T, util::noise::lerp_t<T> L>
constexpr T T
value<T,L>::operator() (util::point<2,T> p) const value<T,L>::operator() (util::point<2,T> p) const
{ {
// extract integer and fractional parts. be careful to always round down // extract integer and fractional parts. be careful to always round down
@ -92,7 +92,7 @@ namespace util { namespace noise { namespace basis {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// Generate a type from [-UNIT..UNIT] // Generate a type from [-UNIT..UNIT]
template <typename T, lerp_t<T> L> template <typename T, lerp_t<T> L>
constexpr T T
value<T,L>::generate (point<2,intmax_t> p) const value<T,L>::generate (point<2,intmax_t> p) const
{ {
using util::hash::murmur2::mix; using util::hash::murmur2::mix;

View File

@ -28,13 +28,13 @@ namespace util { namespace noise { namespace basis {
worley (seed_t); worley (seed_t);
range<T> bounds (void) const; range<T> bounds (void) const;
constexpr T operator() (util::point<2,T>) const; T operator() (util::point<2,T>) const;
constexpr seed_t seed (void) const; seed_t seed (void) const;
seed_t seed (seed_t); seed_t seed (seed_t);
private: private:
constexpr point<2,T> generate (point<2,intmax_t>) const; point<2,T> generate (point<2,intmax_t>) const;
seed_t m_seed; seed_t m_seed;
}; };
} } } } } }

View File

@ -43,7 +43,7 @@ namespace util { namespace noise { namespace basis {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, size_t F> template <typename T, size_t F>
constexpr seed_t seed_t
worley<T,F>::seed (void) const worley<T,F>::seed (void) const
{ {
return m_seed; return m_seed;
@ -61,7 +61,7 @@ namespace util { namespace noise { namespace basis {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, size_t F> template <typename T, size_t F>
constexpr T T
worley<T,F>::operator() (util::point<2,T> p) const worley<T,F>::operator() (util::point<2,T> p) const
{ {
// extract integer and fractional parts. be careful to always round down // extract integer and fractional parts. be careful to always round down
@ -101,7 +101,7 @@ namespace util { namespace noise { namespace basis {
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
template <typename T, size_t F> template <typename T, size_t F>
constexpr point<2,T> point<2,T>
worley<T,F>::generate (point<2,intmax_t> p) const worley<T,F>::generate (point<2,intmax_t> p) const
{ {
using util::hash::murmur2::mix; using util::hash::murmur2::mix;

View File

@ -58,7 +58,7 @@ namespace util { namespace noise { namespace fractal {
constexpr T lacunarity (void) const; constexpr T lacunarity (void) const;
T lacunarity (T); T lacunarity (T);
constexpr seed_t seed (void) const; seed_t seed (void) const;
seed_t seed (seed_t); seed_t seed (seed_t);
const B& basis (void) const; const B& basis (void) const;

View File

@ -136,7 +136,7 @@ namespace util { namespace noise { namespace fractal {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
template <typename T, typename B> template <typename T, typename B>
constexpr typename base<T,B>::seed_t typename base<T,B>::seed_t
base<T,B>::seed (void) const base<T,B>::seed (void) const
{ {
return m_basis.seed (); return m_basis.seed ();

View File

@ -53,7 +53,7 @@ namespace util { namespace noise { namespace fractal {
T gain); T gain);
fbm (seed_t); fbm (seed_t);
constexpr T operator() (util::point<2,T>) const; T operator() (util::point<2,T>) const;
}; };
} } } } } }

View File

@ -56,7 +56,7 @@ namespace util { namespace noise { namespace fractal {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
template <typename T, typename B> template <typename T, typename B>
constexpr T T
fbm<T,B>::operator() (util::point<2,T> p) const fbm<T,B>::operator() (util::point<2,T> p) const
{ {
T total = 0; T total = 0;

View File

@ -48,7 +48,7 @@ namespace util { namespace noise { namespace fractal {
hetero (seed_t); hetero (seed_t);
constexpr T operator() (util::point<2,T>) const; T operator() (util::point<2,T>) const;
private: private:
T m_offset; T m_offset;

View File

@ -57,7 +57,7 @@ namespace util { namespace noise { namespace fractal {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
template <typename T, typename B> template <typename T, typename B>
constexpr T T
hetero<T,B>::operator() (util::point<2,T> p) const hetero<T,B>::operator() (util::point<2,T> p) const
{ {
T scale = this->m_invAH; T scale = this->m_invAH;

View File

@ -48,7 +48,7 @@ namespace util { namespace noise { namespace fractal {
hmf (seed_t); hmf (seed_t);
constexpr T operator() (point<2,T>) const; T operator() (point<2,T>) const;
private: private:
T m_offset; T m_offset;

View File

@ -58,7 +58,7 @@ namespace util { namespace noise { namespace fractal {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
template <typename T, typename B> template <typename T, typename B>
constexpr T T
hmf<T,B>::operator() (util::point<2,T> p) const hmf<T,B>::operator() (util::point<2,T> p) const
{ {
T scale = this->m_invAH; T scale = this->m_invAH;

View File

@ -55,7 +55,7 @@ namespace util { namespace noise { namespace fractal {
rmf (seed_t); rmf (seed_t);
constexpr T operator() (util::point<2,T>) const; T operator() (util::point<2,T>) const;
private: private:
T m_offset; T m_offset;

View File

@ -60,7 +60,7 @@ namespace util { namespace noise { namespace fractal {
// we use the name 'amplitude' instead of musgrave's 'gain'. // we use the name 'amplitude' instead of musgrave's 'gain'.
// assumes basis distribution [-1,1] and offset ~= 1 // assumes basis distribution [-1,1] and offset ~= 1
template <typename T, typename B> template <typename T, typename B>
constexpr T T
rmf<T,B>::operator() (util::point<2,T> p) const rmf<T,B>::operator() (util::point<2,T> p) const
{ {
T scale = this->m_invAH; T scale = this->m_invAH;