X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fnoise.hpp;h=cbfd48ee441ad62722490a8f51e4c4150a58484a;hb=1121e49e7cad94ce4efd0a02c72a44469c81494e;hp=3c4609e566a041d838a626096ca0c849bad8fd53;hpb=7554debb33158b1507c13f9d6fb5969345a570cd;p=blank.git diff --git a/src/noise.hpp b/src/noise.hpp index 3c4609e..cbfd48e 100644 --- a/src/noise.hpp +++ b/src/noise.hpp @@ -18,14 +18,14 @@ public: bool operator ()() noexcept; template - void operator ()(T &out) noexcept { + T operator ()(T &out) noexcept { constexpr int num_bits = std::numeric_limits::digits + std::numeric_limits::is_signed; for (int i = 0; i < num_bits; ++i) { operator ()(); } - out = static_cast(state); + return out = static_cast(state); } private: @@ -45,13 +45,13 @@ public: float operator ()(const glm::vec3 &) const noexcept; private: - unsigned char Perm(size_t idx) const noexcept; - unsigned char Perm12(size_t idx) const noexcept; - const glm::vec3 &Grad(unsigned char idx) const noexcept; + int Perm(int idx) const noexcept; + int Perm12(int idx) const noexcept; + const glm::vec3 &Grad(int idx) const noexcept; private: - unsigned char perm[512]; - unsigned char perm12[512]; + int perm[512]; + int perm12[512]; glm::vec3 grad[12]; };