Freeciv-3.1
Loading...
Searching...
No Matches
mapgen_topology.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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__MAPGEN_TOPOLOGY_H
14#define FC__MAPGEN_TOPOLOGY_H
15
16/* utility */
17#include "support.h" /* bool type */
18
19/* this is the maximal colatitude at equators returned by
20 map_colatitude */
21
22#define MAX_COLATITUDE 1000
23
24int get_sqsize(void);
25
26/* Size safe Unit of colatitude. 0 is not allowed due to possibility of
27 * division by 0 in mapgen.c */
28#define L_UNIT MAX(1, wld.map.server.size * MAX_COLATITUDE / (30 * get_sqsize()))
29
30/* Define the 3 regions of a Earth like map:
31 0 - COLD_LV: cold region
32 COLD_LV - TREOPICAL_LV: temperate wet region
33 TROPICAL_LV - MAX_COLATITUDE: tropical wet region
34 and a dry region, this last one can overlap others
35 DRY_MIN_LEVEL - DRY_MAX_LEVEL */
36#define COLD_LEVEL \
37 (MAX(0, MAX_COLATITUDE * (60*7 - wld.map.server.temperature * 6 ) / 700))
38#define TROPICAL_LEVEL \
39 (MIN(MAX_COLATITUDE * 9 /10, \
40 MAX_COLATITUDE * (143*7 - wld.map.server.temperature * 10) / 700))
41#define DRY_MIN_LEVEL \
42 (MAX_COLATITUDE * (7300 - wld.map.server.temperature * 18 ) / 10000)
43#define DRY_MAX_LEVEL \
44 (MAX_COLATITUDE * (7300 + wld.map.server.temperature * 17 ) / 10000)
45
46/* Used to create the poles and for separating them. In a
47 * mercator projection map we don't want the poles to be too big. */
48extern int ice_base_colatitude;
49#define ICE_BASE_LEVEL ice_base_colatitude
50
51int map_colatitude(const struct tile *ptile);
52bool near_singularity(const struct tile *ptile);
53void generator_init_topology(bool autosize);
54
55#endif /* FC__MAPGEN_TOPOLOGY_H */
void generator_init_topology(bool autosize)
int get_sqsize(void)
int ice_base_colatitude
int map_colatitude(const struct tile *ptile)
bool near_singularity(const struct tile *ptile)
Definition tile.h:49