summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dgn-proclayouts.cc
diff options
context:
space:
mode:
authorBrendan Hickey <brendan@bhickey.net>2013-03-05 21:01:21 -0800
committerBrendan Hickey <brendan@bhickey.net>2013-03-05 21:03:04 -0800
commitd5dae38f9b7aa4a8f063941057d9dd57454ddc17 (patch)
tree3b0b3e09ffa742b12a9363add9424f106f623517 /crawl-ref/source/dgn-proclayouts.cc
parent32850401957467ece3ac58d7537b6bbed296569e (diff)
downloadcrawl-ref-d5dae38f9b7aa4a8f063941057d9dd57454ddc17.tar.gz
crawl-ref-d5dae38f9b7aa4a8f063941057d9dd57454ddc17.zip
Add Burstiness to clamp layout.
Add a burstiness option to clamp layout. When picking the turn on which a feature might change, generate two 32-bit values and AND them together.
Diffstat (limited to 'crawl-ref/source/dgn-proclayouts.cc')
-rw-r--r--crawl-ref/source/dgn-proclayouts.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/dgn-proclayouts.cc b/crawl-ref/source/dgn-proclayouts.cc
index 5655067837..ac404fff1f 100644
--- a/crawl-ref/source/dgn-proclayouts.cc
+++ b/crawl-ref/source/dgn-proclayouts.cc
@@ -278,6 +278,11 @@ ProceduralSample
ClampLayout::operator()(const coord_def &p, const uint32_t offset) const
{
uint32_t order = hash3(p.x, p.y, 0xDEADBEEF);
+ if (bursty)
+ {
+ order &= hash3(p.x + 31, p.y - 37, 0x0DEFACED);
+ }
+ order %= clamp;
uint32_t clamp_offset = (offset + order) / clamp * clamp;
ProceduralSample sample = layout(p, clamp_offset);
uint32_t cp = max(sample.changepoint(), offset + order);