53 factor =
MIN(factor, 0.1);
83 if (
hmap(ptile) == 0) {
90 hmap(ptile) /= factor;
107 for (; i < smooth; i++) {
127 if (((yb - yt <= 0) || (xr - xl <= 0))
128 || ((yb - yt == 1) && (xr - xl == 1))) {
146#define set_midpoints(X, Y, V) \
148 struct tile *ptile = native_pos_to_tile(&(wld.map), (X), (Y)); \
149 if (map_colatitude(ptile) <= ICE_BASE_LEVEL / 2) { \
151 hmap(ptile) = (V) * (100 - wld.map.server.flatpoles) / 100; \
152 } else if (near_singularity(ptile) \
153 || hmap(ptile) != 0) { \
171 ((val[0][0] + val[0][1] + val[1][0] + val[1][1]) / 4
177 gen5rec(2 *
step / 3, xl, yt, (xr + xl) / 2, (yb + yt) / 2);
178 gen5rec(2 *
step / 3, xl, (yb + yt) / 2, (xr + xl) / 2, yb);
179 gen5rec(2 *
step / 3, (xr + xl) / 2, yt, xr, (yb + yt) / 2);
180 gen5rec(2 *
step / 3, (xr + xl) / 2, (yb + yt) / 2, xr, yb);
206 const int xdiv = 5 + extra_div;
207 const int ydiv = 5 + extra_div;
209 int xdiv2 = xdiv + (xnowrap ? 1 : 0);
210 int ydiv2 = ydiv + (ynowrap ? 1 : 0);
214 int x_current, y_current;
226 for (x_current = 0; x_current < xdiv2; x_current++) {
227 for (y_current = 0; y_current < ydiv2; y_current++) {
229 (x_current * xmax / xdiv), (y_current * ymax / ydiv)) {
235 hmap(ptile) -= avoidedge;
247 for (x_current = 0; x_current < xdiv; x_current++) {
248 for (y_current = 0; y_current < ydiv; y_current++) {
249 gen5rec(
step, x_current * xmax / xdiv, y_current * ymax / ydiv,
250 (x_current + 1) * xmax / xdiv, (y_current + 1) * ymax / ydiv);
271 int higher_than_me = 0;
274 if (
hmap(tile1) > thill) {
277 if (
hmap(tile1) > my_height) {
281 if (++higher_than_me > 2) {
static void gen5rec(int step, int xl, int yt, int xr, int yb)
void renormalize_hmap_poles(void)
static float hmap_pole_factor(struct tile *ptile)
void normalize_hmap_poles(void)
#define set_midpoints(X, Y, V)
bool area_is_too_flat(struct tile *ptile, int thill, int my_height)
void make_pseudofractal1_hmap(int extra_div)
void make_random_hmap(int smooth)
struct tile * native_pos_to_tile(const struct civ_map *nmap, int nat_x, int nat_y)
int map_distance(const struct tile *tile0, const struct tile *tile1)
#define current_topo_has_flag(flag)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
#define whole_map_iterate(_map, _tile)
#define whole_map_iterate_end
int map_colatitude(const struct tile *ptile)
bool near_singularity(const struct tile *ptile)
void smooth_int_map(int *int_map, bool zeroes_at_edges)
#define do_in_map_pos_end
#define do_in_map_pos(nmap, ptile, nat_x, nat_y)
#define adjust_int_map(int_map, int_map_max)
#define INITIALIZE_ARRAY(array, size, value)
struct civ_map::@41::@43 server