48 factor =
MIN(factor, 0.1);
81 if (
hmap(ptile) == 0) {
88 hmap(ptile) /= factor;
110 for (
int i = 0; i < smooth; i++) {
130 if (((yb - yt <= 0) || (xr - xl <= 0))
131 || ((yb - yt == 1) && (xr - xl == 1))) {
149 #define set_midpoints(X, Y, V) \
151 struct tile *ptile = native_pos_to_tile(&(wld.map), (X), (Y)); \
152 if (map_colatitude(ptile) <= ICE_BASE_LEVEL / 2) { \
154 hmap(ptile) = (V) * (100 - wld.map.server.flatpoles) / 100; \
155 } else if (near_singularity(ptile) || hmap(ptile) != 0) { \
177 ((val[0][0] + val[0][1] + val[1][0] + val[1][1]) / 4
183 gen5rec(2 *
step / 3, xl, yt, (xr + xl) / 2, (yb + yt) / 2);
184 gen5rec(2 *
step / 3, xl, (yb + yt) / 2, (xr + xl) / 2, yb);
185 gen5rec(2 *
step / 3, (xr + xl) / 2, yt, xr, (yb + yt) / 2);
186 gen5rec(2 *
step / 3, (xr + xl) / 2, (yb + yt) / 2, xr, yb);
212 const int extra_div = 1
217 const int xdiv = 5 + extra_div;
218 const int ydiv = 5 + extra_div;
220 int xdiv2 = xdiv + (xnowrap ? 1 : 0);
221 int ydiv2 = ydiv + (ynowrap ? 1 : 0);
225 int x_current, y_current;
237 for (x_current = 0; x_current < xdiv2; x_current++) {
238 for (y_current = 0; y_current < ydiv2; y_current++) {
240 (y_current * ymax / ydiv))
247 hmap(ptile) -= avoidedge;
260 for (x_current = 0; x_current < xdiv; x_current++) {
261 for (y_current = 0; y_current < ydiv; y_current++) {
262 gen5rec(
step, x_current * xmax / xdiv, y_current * ymax / ydiv,
263 (x_current + 1) * xmax / xdiv, (y_current + 1) * ymax / ydiv);
287 int higher_than_me = 0;
291 if (
hmap(tile1) > thill) {
294 if (
hmap(tile1) > my_height) {
298 if (++higher_than_me > 2) {
static void gen5rec(int step, int xl, int yt, int xr, int yb)
Recursive function which does the work for generator 5.
static float hmap_pole_factor(struct tile *ptile)
Factor by which to lower height map near poles in normalize_hmap_poles.
void make_random_hmap()
Create uncorrelated rand map and do some call to smoth to correlate it a little and create randoms sh...
void renormalize_hmap_poles()
Invert (most of) the effects of normalize_hmap_poles so that we have accurate heights for texturing t...
void normalize_hmap_poles()
Lower the land near the map edges and (optionally) the polar region to avoid too much land there.
#define set_midpoints(X, Y, V)
bool area_is_too_flat(struct tile *ptile, int thill, int my_height)
We don't want huge areas of grass/plains, so we put in a hill here and there, where it gets too 'clea...
void make_pseudofractal_hmap()
Generator 5 makes earthlike worlds with one or more large continents and a scattering of smaller isla...
struct tile * native_pos_to_tile(const struct civ_map *nmap, int nat_x, int nat_y)
Return the tile for the given native position.
int map_distance(const struct tile *tile0, const struct tile *tile1)
Return Manhattan distance between two tiles.
#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 get_sqsize()
An estimate of the linear (1-dimensional) size of the map.
int map_colatitude(const struct tile *ptile)
Returns the colatitude of this map position.
bool near_singularity(const struct tile *ptile)
Return TRUE if the map in a typical city radius is SINGULAR.
void smooth_int_map(int *int_map, bool zeroes_at_edges)
Apply a Gaussian diffusion filter on the map.
#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)
int player_count()
Return the number of players.
#define INITIALIZE_ARRAY(array, size, value)
struct civ_map::@39::@41 server