noise/midpoint: use explicit image extent query

This commit is contained in:
Danny Robson 2015-10-19 17:07:39 +11:00
parent 36b4043faf
commit f9bb2be93c

View File

@ -101,11 +101,13 @@ template <typename T>
void
util::noise::midpoint (image::buffer<T> &img, uint64_t seed, float persistence, float sides)
{
auto ext = img.extent ();
static const util::point2u CORNERS[] = {
{ 0, 0 },
{ 0, img.w - 1 },
{ img.h - 1, 0 },
{ img.h - 1, img.w - 1 }
{ 0, ext.w - 1 },
{ ext.h - 1, 0 },
{ ext.h - 1, ext.w - 1 }
};
for (auto i: CORNERS)