diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-01-16 22:50:34 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-01-16 22:50:49 +0530 |
commit | c0aa968809c8d8ef88048edd667b12b297a68602 (patch) | |
tree | d7d3146cb30af8917fa2327ef9915158fab6bc71 /crawl-ref/source/dgn-height.cc | |
parent | fc861cd85fb2044058363096b391f1c21ec8e660 (diff) | |
download | crawl-ref-c0aa968809c8d8ef88048edd667b12b297a68602.tar.gz crawl-ref-c0aa968809c8d8ef88048edd667b12b297a68602.zip |
Experimental level builder changes for Swamp.
The Swamp now gets a border of trees and uses trees instead of walls. Swamp:5 vaults may need tweaking to fit in better.
Diffstat (limited to 'crawl-ref/source/dgn-height.cc')
-rw-r--r-- | crawl-ref/source/dgn-height.cc | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/crawl-ref/source/dgn-height.cc b/crawl-ref/source/dgn-height.cc index 8a52736fb5..16d54c17f8 100644 --- a/crawl-ref/source/dgn-height.cc +++ b/crawl-ref/source/dgn-height.cc @@ -11,8 +11,6 @@ #include "dungeon.h" #include "random.h" -const int SHOALS_ISLAND_COLLIDE_DIST2 = 5 * 5; - void dgn_initialise_heightmap(int height) { env.heightmap.reset(new grid_heightmap); @@ -70,35 +68,23 @@ void dgn_smooth_heights(int radius, int npasses) { for (int i = 0; i < npasses; ++i) { - for (rectangle_iterator ri(0); ri; ++ri) - dgn_smooth_height_at(*ri, radius); + const int xspan = GXM / 2, yspan = GYM / 2; + for (int y = yspan - 1; y >= 0; --y) + for (int x = xspan - 1; x >= 0; --x) + { + dgn_smooth_height_at(coord_def(x, y), radius); + dgn_smooth_height_at(coord_def(2 * xspan - x - 1, y), radius); + dgn_smooth_height_at(coord_def(x, 2 * yspan - y - 1), radius); + dgn_smooth_height_at(coord_def(2 * xspan - x - 1, + 2 * yspan - y - 1), + radius); + } } } ////////////////////////////////////////////////////////////////////// // dgn_island_plan -dgn_island_plan dgn_island_plan::shoals_islands(int margin) -{ - dgn_island_plan plan; - plan.level_border_depth = margin; - plan.n_aux_centres = int_range(0, 3); - plan.aux_centre_offset_range = int_range(2, 10); - - plan.atoll_roll = 10; - plan.island_separation_dist2 = SHOALS_ISLAND_COLLIDE_DIST2; - - plan.n_island_centre_delta_points = int_range(50, 60); - plan.island_centre_radius_range = int_range(3, 10); - plan.island_centre_point_height_increment = int_range(40, 60); - - plan.n_island_aux_delta_points = int_range(25, 45); - plan.island_aux_radius_range = int_range(2, 7); - plan.island_aux_point_height_increment = int_range(25, 35); - - return (plan); -} - void dgn_island_plan::build(int nislands) { for (int i = 0; i < nislands; ++i) |