Freeciv21
Develop your civilization from humble roots to a global empire
height_map.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 #pragma once
12 
13 /* Wrappers for easy access. They are a macros so they can be a lvalues.*/
14 #define hmap(_tile) (height_map[tile_index(_tile)])
15 
16 // shore_level safe unit of height
17 #define H_UNIT MIN(1, (hmap_max_level - hmap_shore_level) / 100)
18 
19 /*
20  * Height map information
21  *
22  * height_map[] stores the height of each tile
23  * hmap_max_level is the maximum height (heights will range from
24  * [0,hmap_max_level).
25  * hmap_shore_level is the level of ocean. Any tile at this height or
26  * above is land; anything below is ocean.
27  * hmap_mount_level is the level of mountains and hills. Any tile above
28  * this height will usually be a mountain or hill.
29  */
30 #define hmap_max_level 1000
31 extern int *height_map;
33 
36 void make_random_hmap();
38 
39 bool area_is_too_flat(struct tile *ptile, int thill, int my_height);
int hmap_mountain_level
Definition: height_map.h:32
void make_random_hmap()
Create uncorrelated rand map and do some call to smoth to correlate it a little and create randoms sh...
Definition: height_map.cpp:99
void renormalize_hmap_poles()
Invert (most of) the effects of normalize_hmap_poles so that we have accurate heights for texturing t...
Definition: height_map.cpp:77
void normalize_hmap_poles()
Lower the land near the map edges and (optionally) the polar region to avoid too much land there.
Definition: height_map.cpp:59
int hmap_shore_level
Definition: height_map.cpp:24
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...
Definition: height_map.cpp:285
void make_pseudofractal_hmap()
Generator 5 makes earthlike worlds with one or more large continents and a scattering of smaller isla...
Definition: height_map.cpp:203
int * height_map
Definition: height_map.cpp:23
Definition: tile.h:42