// Copyright (C) 2016 Rémi Bèges // This file is part of the "Nazara Engine - Noise module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include namespace Nz { int fastfloor(float n) { return (n >= 0) ? static_cast(n) : static_cast(n-1); } int JenkinsHash(int a, int b, int c) { a = a-b; a = a - c; a = a^(static_cast(c) >> 13); b = b-c; b = b - a; b = b^(a << 8); c = c-a; c = c - b; c = c^(static_cast(b) >> 13); a = a-b; a = a - c; a = a^(static_cast(c) >> 12); b = b-c; b = b - a; b = b^(a << 16); c = c-a; c = c - b; c = c^(static_cast(b) >> 5); a = a-b; a = a - c; a = a^(static_cast(c) >> 3); b = b-c; b = b - a; b = b^(a << 10); c = c-a; c = c - b; c = c^(static_cast(b) >> 15); return c; } }