Freeciv21
Develop your civilization from humble roots to a global empire
mapgen_topology.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 // utility
16 #include "support.h" // bool type
17 
18 /* this is the maximal colatitude at equators returned by
19  map_colatitude */
20 
21 #define MAX_COLATITUDE 1000
22 
23 int get_sqsize();
24 
25 /* Size safe Unit of colatitude. 0 is not allowed due to possibility of
26  * division by 0 in mapgen.c */
27 #define L_UNIT \
28  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 ovelap 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. */
48 extern int ice_base_colatitude;
49 #define ICE_BASE_LEVEL ice_base_colatitude
50 
51 int map_colatitude(const struct tile *ptile);
52 bool near_singularity(const struct tile *ptile);
53 void generator_init_topology(bool autosize);
int get_sqsize()
An estimate of the linear (1-dimensional) size of the map.
void generator_init_topology(bool autosize)
This function sets sizes in a topology-specific way then calls map_init_topology().
int ice_base_colatitude
int map_colatitude(const struct tile *ptile)
Returns the colatitude of this map position.
bool near_singularity(const struct tile *ptile)
Return TRUE if the map in a typical city radius is SINGULAR.
Definition: tile.h:42