Freeciv-3.2
Loading...
Searching...
No Matches
Macros | Functions | Variables
mapgen_topology.h File Reference
#include "support.h"

Go to the source code of this file.

Macros

#define MAX_COLATITUDE   MAP_MAX_LATITUDE
 
#define colat_from_abs_lat(_lat)   (MAX_COLATITUDE - _lat)
 
#define MAX_REAL_COLATITUDE(_nmap)    colat_from_abs_lat(MAP_MIN_ABS_LATITUDE(_nmap))
 
#define MIN_REAL_COLATITUDE(_nmap)    colat_from_abs_lat(MAP_MAX_ABS_LATITUDE(_nmap))
 
#define REAL_COLATITUDE_RANGE(_nmap)    (MAX_REAL_COLATITUDE(_nmap) - MIN_REAL_COLATITUDE(_nmap))
 
#define L_UNIT   MAX(1, wld.map.server.size * MAX_COLATITUDE / (30 * get_sqsize()))
 
#define COLD_LEVEL    (MAX(0, MAX_COLATITUDE * (60*7 - wld.map.server.temperature * 6 ) / 700))
 
#define TROPICAL_LEVEL
 
#define DRY_MIN_LEVEL    (MAX_COLATITUDE * (7300 - wld.map.server.temperature * 18 ) / 10000)
 
#define DRY_MAX_LEVEL    (MAX_COLATITUDE * (7300 + wld.map.server.temperature * 17 ) / 10000)
 
#define ICE_BASE_LEVEL   ice_base_colatitude
 

Functions

int get_sqsize (void)
 
int map_colatitude (const struct tile *ptile)
 
bool near_singularity (const struct tile *ptile)
 
void generator_init_topology (bool autosize)
 

Variables

int ice_base_colatitude
 

Macro Definition Documentation

◆ colat_from_abs_lat

#define colat_from_abs_lat (   _lat)    (MAX_COLATITUDE - _lat)

Definition at line 24 of file mapgen_topology.h.

◆ COLD_LEVEL

#define COLD_LEVEL    (MAX(0, MAX_COLATITUDE * (60*7 - wld.map.server.temperature * 6 ) / 700))

Definition at line 50 of file mapgen_topology.h.

◆ DRY_MAX_LEVEL

#define DRY_MAX_LEVEL    (MAX_COLATITUDE * (7300 + wld.map.server.temperature * 17 ) / 10000)

Definition at line 57 of file mapgen_topology.h.

◆ DRY_MIN_LEVEL

#define DRY_MIN_LEVEL    (MAX_COLATITUDE * (7300 - wld.map.server.temperature * 18 ) / 10000)

Definition at line 55 of file mapgen_topology.h.

◆ ICE_BASE_LEVEL

#define ICE_BASE_LEVEL   ice_base_colatitude

Definition at line 63 of file mapgen_topology.h.

◆ L_UNIT

#define L_UNIT   MAX(1, wld.map.server.size * MAX_COLATITUDE / (30 * get_sqsize()))

Definition at line 42 of file mapgen_topology.h.

◆ MAX_COLATITUDE

#define MAX_COLATITUDE   MAP_MAX_LATITUDE

Definition at line 21 of file mapgen_topology.h.

◆ MAX_REAL_COLATITUDE

#define MAX_REAL_COLATITUDE (   _nmap)     colat_from_abs_lat(MAP_MIN_ABS_LATITUDE(_nmap))

Definition at line 31 of file mapgen_topology.h.

◆ MIN_REAL_COLATITUDE

#define MIN_REAL_COLATITUDE (   _nmap)     colat_from_abs_lat(MAP_MAX_ABS_LATITUDE(_nmap))

Definition at line 33 of file mapgen_topology.h.

◆ REAL_COLATITUDE_RANGE

#define REAL_COLATITUDE_RANGE (   _nmap)     (MAX_REAL_COLATITUDE(_nmap) - MIN_REAL_COLATITUDE(_nmap))

Definition at line 35 of file mapgen_topology.h.

◆ TROPICAL_LEVEL

#define TROPICAL_LEVEL
Value:
(MIN(MAX_COLATITUDE * 9 /10, \
MAX_COLATITUDE * (143*7 - wld.map.server.temperature * 10) / 700))
struct world wld
Definition game.c:63
#define MAX_COLATITUDE
#define MIN(x, y)
Definition shared.h:55
struct civ_map::@42::@44 server
int temperature
Definition map_types.h:103
struct civ_map map

Definition at line 52 of file mapgen_topology.h.

Function Documentation

◆ generator_init_topology()

void generator_init_topology ( bool  autosize)

This function sets sizes in a topology-specific way then calls map_init_topology(). Set 'autosize' to TRUE if the xsize/ysize should be calculated.

Definition at line 165 of file mapgen_topology.c.

Referenced by map_fractal_generate().

◆ get_sqsize()

int get_sqsize ( void  )

An estimate of the linear (1-dimensional) size of the map.

Definition at line 271 of file mapgen_topology.c.

Referenced by generator_init_topology(), make_fracture_map(), and map_fractal_generate().

◆ map_colatitude()

int map_colatitude ( const struct tile ptile)

Returns the colatitude of this map position. This is a value in the range of 0 to MAX_COLATITUDE (inclusive). This function is wanted to concentrate the topology information all generator code has to use colatitude and others topology safe functions instead (x,y) coordinate to place terrains colatitude is 0 at poles and MAX_COLATITUDE at equator

Definition at line 38 of file mapgen_topology.c.

Referenced by create_tmap(), hmap_pole_factor(), make_pseudofractal1_hmap(), make_river(), normalize_hmap_poles(), place_terrain(), and renormalize_hmap_poles().

◆ near_singularity()

bool near_singularity ( const struct tile ptile)

Return TRUE if the map in a typical city radius is SINGULAR. This is used to avoid putting (non-polar) land near the edge of the map.

Definition at line 53 of file mapgen_topology.c.

Referenced by create_island(), hmap_pole_factor(), make_pseudofractal1_hmap(), and normalize_hmap_poles().

Variable Documentation

◆ ice_base_colatitude

int ice_base_colatitude
extern

Definition at line 28 of file mapgen_topology.c.

Referenced by generator_init_topology().