![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "rand.h"#include "map.h"#include "mapgen_topology.h"#include "mapgen_utils.h"#include "height_map.h"
Include dependency graph for height_map.cpp:Go to the source code of this file.
Macros | |
| #define | set_midpoints(X, Y, V) |
Functions | |
| static float | hmap_pole_factor (struct tile *ptile) |
| Factor by which to lower height map near poles in normalize_hmap_poles. More... | |
| void | normalize_hmap_poles () |
| Lower the land near the map edges and (optionally) the polar region to avoid too much land there. More... | |
| void | renormalize_hmap_poles () |
| Invert (most of) the effects of normalize_hmap_poles so that we have accurate heights for texturing the poles. More... | |
| void | make_random_hmap () |
| Create uncorrelated rand map and do some call to smoth to correlate it a little and create randoms shapes. More... | |
| static void | gen5rec (int step, int xl, int yt, int xr, int yb) |
| Recursive function which does the work for generator 5. More... | |
| void | make_pseudofractal_hmap () |
| Generator 5 makes earthlike worlds with one or more large continents and a scattering of smaller islands. More... | |
| 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 'clean'. More... | |
Variables | |
| int * | height_map = nullptr |
| int | hmap_shore_level = 0 |
| int | hmap_mountain_level = 0 |
| #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 'clean'.
Return TRUE if the terrain around the given map position is "clean". This means that all the terrain for 2 squares around it is not mountain or hill.
Definition at line 285 of file height_map.cpp.
Referenced by make_fracture_relief(), and make_relief().
|
static |
Recursive function which does the work for generator 5.
All (x0,y0) and (x1,y1) are in native coordinates.
Definition at line 122 of file height_map.cpp.
Referenced by make_pseudofractal_hmap().
|
static |
Factor by which to lower height map near poles in normalize_hmap_poles.
Definition at line 29 of file height_map.cpp.
Referenced by normalize_hmap_poles(), and renormalize_hmap_poles().
| void make_pseudofractal_hmap | ( | ) |
Generator 5 makes earthlike worlds with one or more large continents and a scattering of smaller islands.
It does so by dividing the world into blocks and on each block raising or lowering the corners, then the midpoints and middle and so on recursively. Fiddling with 'xdiv' and 'ydiv' will change the size of the initial blocks and, if the map does not wrap in at least one direction, fiddling with 'avoidedge' will change the liklihood of continents butting up to non-wrapped edges.
All X and Y values used in this function are in native coordinates.
extra_div can be increased to break the world up into more, smaller islands. This is used in conjunction with the startpos setting.
Definition at line 203 of file height_map.cpp.
Referenced by map_generate().
| void make_random_hmap | ( | ) |
Create uncorrelated rand map and do some call to smoth to correlate it a little and create randoms shapes.
Definition at line 99 of file height_map.cpp.
Referenced by map_generate().
| void normalize_hmap_poles | ( | ) |
Lower the land near the map edges and (optionally) the polar region to avoid too much land there.
See also renormalize_hmap_poles
Definition at line 59 of file height_map.cpp.
Referenced by make_land().
| void renormalize_hmap_poles | ( | ) |
Invert (most of) the effects of normalize_hmap_poles so that we have accurate heights for texturing the poles.
Definition at line 77 of file height_map.cpp.
Referenced by make_land().
| int* height_map = nullptr |
Definition at line 23 of file height_map.cpp.
Referenced by create_island(), initworld(), make_fracture_hmap(), make_pseudofractal_hmap(), make_random_hmap(), map_generate(), map_generate_island_2or3(), map_generate_island_single(), and map_generate_island_variable().
| int hmap_mountain_level = 0 |
Definition at line 24 of file height_map.cpp.
| int hmap_shore_level = 0 |
Definition at line 24 of file height_map.cpp.
Referenced by area_is_too_flat(), create_tmap(), make_fracture_hmap(), make_fracture_relief(), make_land(), and make_relief().