Freeciv-3.3
Loading...
Searching...
No Matches
height_map.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2007 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__HEIGHT_MAP_H
14#define FC__HEIGHT_MAP_H
15
16/* Wrappers for easy access. They are a macros so they can be lvalues.*/
17#define hmap(_tile) (height_map[tile_index(_tile)])
18
19/* shore_level safe unit of height */
20#define H_UNIT MIN(1, (hmap_max_level - hmap_shore_level) / 100)
21
22/*
23 * Height map information
24 *
25 * height_map[] stores the height of each tile
26 * hmap_max_level is the maximum height (heights will range from
27 * [0, hmap_max_level).
28 * hmap_shore_level is the level of ocean. Any tile at this height or
29 * above is land; anything below is ocean.
30 * hmap_mount_level is the level of mountains and hills. Any tile above
31 * this height will usually be a mountain or hill.
32 */
33#define hmap_max_level 1000
34extern int *height_map;
36
37void normalize_hmap_poles(void);
38void renormalize_hmap_poles(void);
39void make_random_hmap(int smooth);
41
42bool area_is_too_flat(struct tile *ptile, int thill, int my_height);
43
44void height_map_to_map(void);
45
46#endif /* FC__HEIGHT__MAP_H */
char * incite_cost
Definition comments.c:76
void renormalize_hmap_poles(void)
Definition height_map.c:81
int hmap_mountain_level
Definition height_map.h:35
void height_map_to_map(void)
Definition height_map.c:300
void normalize_hmap_poles(void)
Definition height_map.c:65
int hmap_shore_level
Definition height_map.c:30
bool area_is_too_flat(struct tile *ptile, int thill, int my_height)
Definition height_map.c:271
void make_pseudofractal1_hmap(int extra_div)
Definition height_map.c:198
void make_random_hmap(int smooth)
Definition height_map.c:101
int * height_map
Definition height_map.c:29
Definition tile.h:50