diff --git a/image.hpp b/image.hpp index 713ea646..cfd0d7ef 100644 --- a/image.hpp +++ b/image.hpp @@ -49,7 +49,6 @@ namespace util { namespace image { buffer downsample (float factor) const; //--------------------------------------------------------------------- - constexpr size_t area (void) const; constexpr extent2u extent (void) const; constexpr bool is_packed (void) const; diff --git a/image.ipp b/image.ipp index d8e6d60b..4709a1ce 100644 --- a/image.ipp +++ b/image.ipp @@ -20,15 +20,6 @@ #define __UTIL_IMAGE_IPP namespace util { namespace image { - //------------------------------------------------------------------------- - template - constexpr size_t - buffer::area (void) const - { - return w * h; - } - - //------------------------------------------------------------------------- template constexpr extent2u diff --git a/tools/noise.cpp b/tools/noise.cpp index 0b6971de..fca20524 100644 --- a/tools/noise.cpp +++ b/tools/noise.cpp @@ -98,7 +98,7 @@ hydraulic_erode (util::image::buffer &height, const unsigned ticks) } // evaporate water, deposit sediment - for (size_t i = 0; i < water.area (); ++i) { + for (size_t i = 0; i < water.extent ().area (); ++i) { water[i] -= EVAPORATION; height[i] += SOLUBILITY * EVAPORATION; } @@ -107,8 +107,8 @@ hydraulic_erode (util::image::buffer &height, const unsigned ticks) } // forcibly evaporate all remaining water. - CHECK_EQ (water.area (), height.area ()); - for (size_t i = 0; i < water.area (); ++i) + CHECK_EQ (water.extent ().area (), height.extent ().area ()); + for (size_t i = 0; i < water.extent ().area (); ++i) height[i] += water[i] * SOLUBILITY; } @@ -252,7 +252,7 @@ adjust_ocean (util::image::buffer &height, buckets[size_t (h * 255u)]++; size_t pivot = 0; - for (size_t accum = 0, target = size_t (percentage * height.area ()); pivot < buckets.size (); ++pivot) { + for (size_t accum = 0, target = size_t (percentage * height.extent ().area ()); pivot < buckets.size (); ++pivot) { accum += buckets[pivot]; if (accum > target) break;