summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dgn-proclayouts.h
diff options
context:
space:
mode:
authorBrendan Hickey <brendan@bhickey.net>2012-09-04 22:24:33 -0700
committerBrendan Hickey <brendan@bhickey.net>2012-12-30 19:06:10 -0800
commit6e1c33e8f5f423f2bd85072e6c4917eeb799746d (patch)
tree1928fbf4c205c4ebccfc795ead45fe95fdf24f1c /crawl-ref/source/dgn-proclayouts.h
parent34e5bd839508618cfc36ddff48641725a73eed1d (diff)
downloadcrawl-ref-6e1c33e8f5f423f2bd85072e6c4917eeb799746d.tar.gz
crawl-ref-6e1c33e8f5f423f2bd85072e6c4917eeb799746d.zip
Mixed Column Abyss
Procedural layout for the abyss using a mixture of sparse and dense columns!
Diffstat (limited to 'crawl-ref/source/dgn-proclayouts.h')
-rw-r--r--crawl-ref/source/dgn-proclayouts.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/crawl-ref/source/dgn-proclayouts.h b/crawl-ref/source/dgn-proclayouts.h
index 1ccb77036e..66d44f42d6 100644
--- a/crawl-ref/source/dgn-proclayouts.h
+++ b/crawl-ref/source/dgn-proclayouts.h
@@ -10,6 +10,7 @@
#include <vector>
+#include "cellular.h"
#include "enum.h"
#include "externs.h"
#include "perlin.h"
@@ -70,4 +71,38 @@ class ChaoticLayout : public ProceduralLayout
const uint32_t _seed, _density;
dungeon_feature_type feature(uint32_t noise);
};
+
+class WorleyLayout : public ProceduralLayout
+{
+ public:
+ WorleyLayout(uint32_t seed, double scale,
+ ProceduralLayout &a, ProceduralLayout &b)
+ : _seed(seed), _scale(scale), _a(a), _b(b) {}
+ dungeon_feature_type operator()(const coord_def &p, double offset = 0) {
+ double x = p.x * _scale;
+ double y = p.y * _scale;
+ if (worley::worley(x, y, offset).id[0] % 2)
+ return _a(p, offset);
+ return _b(p, offset);
+ }
+ private:
+ uint32_t _seed;
+ double _scale;
+ ProceduralLayout &_a, &_b;
+
+};
+
+
+class MixedColumnLayout : public ProceduralLayout {
+ public:
+ MixedColumnLayout(uint32_t seed) : _seed(seed) {
+ }
+ dungeon_feature_type operator()(const coord_def &p, double offset) {
+ ColumnLayout a(2), b(2,6);
+ return WorleyLayout(_seed, 0.07, a, b)(p, offset);
+ }
+ private:
+ uint32_t _seed;
+};
+
#endif /* PROC_LAYOUTS_H */