diff options
author | Brendan Hickey <brendan@bhickey.net> | 2012-09-03 22:51:56 -0700 |
---|---|---|
committer | Brendan Hickey <brendan@bhickey.net> | 2012-12-30 19:06:10 -0800 |
commit | 78b2a340d67eb1800092d63e2ee9367d594effc7 (patch) | |
tree | cd3179c800afc660f25944b1efdd5e0644ed2fe6 /crawl-ref/source/perlin.cc | |
parent | b8dd3ee7e9f34633c1a9e0556dff292a9ed8f3dc (diff) | |
download | crawl-ref-78b2a340d67eb1800092d63e2ee9367d594effc7.tar.gz crawl-ref-78b2a340d67eb1800092d63e2ee9367d594effc7.zip |
Old Abyss Clone
The old abyss implemented in terms of a procedural layout.
It's currently very thrashy.
Diffstat (limited to 'crawl-ref/source/perlin.cc')
-rw-r--r-- | crawl-ref/source/perlin.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/perlin.cc b/crawl-ref/source/perlin.cc index 0eaf29ceb2..955691210f 100644 --- a/crawl-ref/source/perlin.cc +++ b/crawl-ref/source/perlin.cc @@ -17,7 +17,7 @@ double primes[] = { double theta = 0.81649658092; -static double fhash3(int x, int y, int z) +uint64_t hash3(int x, int y, int z) { // Some compilers choke on big unsigneds, need to give them in hex. uint64_t hash=0xcbf29ce484222325ULL; // 14695981039346656037 @@ -30,7 +30,12 @@ static double fhash3(int x, int y, int z) hash*=FNV64; x=hash ^ (hash >> 27) ^ (hash << 24) ^ (hash >> 48); - return x / 2147483648.0; + return x; +} + +static double fhash3(int x, int y, int z) +{ + return hash3(x, y, z) / 2147483648.0; } static double interpolate(double x, double y, double d) |