Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/generator/height_map.h File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Macros | Functions | Variables
height_map.h File Reference

Go to the source code of this file.

## Macros

#define | hmap(_tile) (height_map[tile_index(_tile)])
#define | H_UNIT MIN(1, (hmap_max_level - hmap_shore_level) / 100)
#define | hmap_max_level 1000

## Functions

void | normalize_hmap_poles (void)
void | renormalize_hmap_poles (void)
void | make_random_hmap (int smooth)
void | make_pseudofractal1_hmap (int extra_div)
bool | area_is_too_flat (struct tile *ptile, int thill, int my_height)

## Variables

int * | height_map
int | hmap_shore_level
int | hmap_mountain_level

## Macro Definition Documentation

## ◆ H_UNIT

#define H_UNIT MIN(1, (hmap_max_level - hmap_shore_level) / 100)

Definition at line 20 of file height_map.h.

## ◆ hmap

#define hmap | ( |  | _tile | ) | (height_map[tile_index(_tile)])

Definition at line 17 of file height_map.h.

## ◆ hmap_max_level

#define hmap_max_level 1000

Definition at line 33 of file height_map.h.

## Function Documentation

## ◆ area_is_too_flat()

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 269 of file height_map.c.

Referenced by make_fracture_relief(), and make_relief().

## ◆ make_pseudofractal1_hmap()

void make_pseudofractal1_hmap | ( | int | extra_div | ) |

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 likelihood 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 197 of file height_map.c.

Referenced by map_fractal_generate().

## ◆ make_random_hmap()

void make_random_hmap | ( | int | smooth | ) |

Create uncorrelated rand map and do some call to smoth to correlate it a little and create random shapes

Definition at line 100 of file height_map.c.

Referenced by map_fractal_generate().

## ◆ normalize_hmap_poles()

void normalize_hmap_poles | ( | void |  | ) |

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 64 of file height_map.c.

Referenced by make_land().

## ◆ renormalize_hmap_poles()

void renormalize_hmap_poles | ( | void |  | ) |

Invert (most of) the effects of normalize_hmap_poles so that we have accurate heights for texturing the poles.

Definition at line 80 of file height_map.c.

Referenced by make_land().

## Variable Documentation

## ◆ height_map

int* height_map

extern

Definition at line 29 of file height_map.c.

Referenced by make_pseudofractal1_hmap(), and make_random_hmap().

## ◆ hmap_mountain_level

int hmap_mountain_level

Definition at line 35 of file height_map.h.

## ◆ hmap_shore_level

int hmap_shore_level

extern

Definition at line 30 of file height_map.c.

Referenced by area_is_too_flat().