Freeciv21
Develop your civilization from humble roots to a global empire
mapgen.h File Reference
#include "fc_types.h"
+ Include dependency graph for mapgen.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HAS_POLES    (wld.map.server.temperature < 70 && !wld.map.server.alltemperate)
 
#define map_pos_is_dry(ptile)
 Conditions used mainly in rand_map_pos_characteristic() More...
 

Enumerations

enum  wetness_c { WC_ALL = 200 , WC_DRY , WC_NDRY }
 

Functions

void make_plains ()
 Make_plains converts all not yet placed terrains to plains (tundra, grass) used by generators 2-4. More...
 
void make_polar ()
 Add frozen tiles in the arctic zone. More...
 
bool test_wetness (const struct tile *ptile, wetness_c c)
 These functions test for conditions used in rand_map_pos_characteristic. More...
 
bool map_generate (bool autosize, struct unit_type *initial_unit)
 See stdinhand.c for information on map generation methods. More...
 

Variables

int forest_pct
 
int desert_pct
 
int swamp_pct
 
int mountain_pct
 
int jungle_pct
 
int river_pct
 
struct extra_typeriver_types [MAX_ROAD_TYPES]
 
int river_type_count
 

Macro Definition Documentation

◆ HAS_POLES

#define HAS_POLES    (wld.map.server.temperature < 70 && !wld.map.server.alltemperate)

Definition at line 15 of file mapgen.h.

◆ map_pos_is_dry

#define map_pos_is_dry (   ptile)
Value:
&& map_colatitude((ptile)) > DRY_MIN_LEVEL \
&& count_terrain_class_near_tile((ptile), false, true, TC_OCEAN) <= 35)
int map_colatitude(const struct tile *ptile)
Returns the colatitude of this map position.
#define DRY_MIN_LEVEL
#define DRY_MAX_LEVEL
int count_terrain_class_near_tile(const struct tile *ptile, bool cardinal_only, bool percentage, enum terrain_class tclass)
Return the number of adjacent tiles that have given terrain class (not including ptile itself).
Definition: terrain.cpp:517

Conditions used mainly in rand_map_pos_characteristic()

Definition at line 24 of file mapgen.h.

Enumeration Type Documentation

◆ wetness_c

enum wetness_c
Enumerator
WC_ALL 
WC_DRY 
WC_NDRY 

Definition at line 28 of file mapgen.h.

Function Documentation

◆ make_plains()

void make_plains ( )

Make_plains converts all not yet placed terrains to plains (tundra, grass) used by generators 2-4.

Definition at line 377 of file mapgen.cpp.

Referenced by map_generate_island_2or3(), map_generate_island_single(), and map_generate_island_variable().

◆ make_polar()

void make_polar ( )

Add frozen tiles in the arctic zone.

If ruleset has frozen ocean, use that, else use frozen land terrains with appropriate texturing. This is used in generators 2-4.

Definition at line 258 of file mapgen.cpp.

Referenced by initworld().

◆ map_generate()

bool map_generate ( bool  autosize,
struct unit_type initial_unit 
)

See stdinhand.c for information on map generation methods.

FIXME: Some continent numbers are unused at the end of this function, fx removed completely by remove_tiny_islands. When this function is finished various data is written to "islands", indexed by continent numbers, so a simple renumbering would not work...

If "autosize" is specified then mapgen will automatically size the map based on the map.server.size server parameter and the specified topology. If not map.xsize and map.ysize will be used.

Definition at line 1232 of file mapgen.cpp.

Referenced by srv_ready().

◆ test_wetness()

bool test_wetness ( const struct tile ptile,
wetness_c  c 
)

These functions test for conditions used in rand_map_pos_characteristic.

Checks if the given location satisfy some wetness condition

Definition at line 122 of file mapgen.cpp.

Referenced by condition_filter(), fill_island(), fill_island_rivers(), and place_terrain().

Variable Documentation

◆ desert_pct

int desert_pct
extern

◆ forest_pct

int forest_pct
extern

◆ jungle_pct

int jungle_pct
extern

◆ mountain_pct

int mountain_pct
extern

◆ river_pct

int river_pct
extern

Definition at line 98 of file mapgen.cpp.

Referenced by adjust_terrain_param(), fair_map_island_new(), make_island(), and make_rivers().

◆ river_type_count

int river_type_count
extern

Definition at line 44 of file mapgen.cpp.

Referenced by fair_map_island_new(), fill_island_rivers(), make_rivers(), and river_types_init().

◆ river_types

struct extra_type* river_types[MAX_ROAD_TYPES]
extern

Definition at line 43 of file mapgen.cpp.

Referenced by fair_map_island_new(), fill_island_rivers(), make_rivers(), and river_types_init().

◆ swamp_pct

int swamp_pct
extern