![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "islands.h"#include "game.h"#include "map.h"#include "map_types.h"#include "terrain.h"#include "height_map.h"#include "mapgen.h"#include "mapgen_topology.h"#include "mapgen_utils.h"#include "temperature_map.h"#include "rand.h"#include "speclist.h"
Include dependency graph for islands.cpp:Go to the source code of this file.
Classes | |
| struct | gen234_state |
| struct | terrain_select |
Macros | |
| #define | SPECLIST_TAG terrain_select |
| #define | terrain_select_list_iterate(tersel_list, ptersel) TYPED_LIST_ITERATE(struct terrain_select, tersel_list, ptersel) |
| #define | terrain_select_list_iterate_end LIST_ITERATE_END |
| #define | DMSIS 10 |
Functions | |
| static struct terrain_select * | tersel_new (int weight, enum mapgen_terrain_property target, enum mapgen_terrain_property prefer, enum mapgen_terrain_property avoid, int temp_condition, int wet_condition) |
| Allocate and initialize new terrain_select structure. More... | |
| static void | tersel_free (struct terrain_select *ptersel) |
| Free resources allocated for terrain_select structure. More... | |
| static void | fill_island (int coast, long int *bucket, const struct terrain_select_list *tersel_list, const struct gen234_state *const pstate) |
| Fill an island with different types of terrains; rivers have extra code. More... | |
| static bool | make_island (int islemass, int starters, struct gen234_state *pstate, int min_specific_island_size) |
| make an island, fill every tile type except plains note: you have to create big islands first. More... | |
| static bool | create_island (int islemass, struct gen234_state *pstate) |
| finds a place and drop the island created when called with islemass != 0 More... | |
| static void | fill_island_rivers (int coast, long int *bucket, const struct gen234_state *const pstate) |
| Fill an island with rivers. More... | |
| static void | island_terrain_init () |
| Initialize terrain selection lists for make_island(). More... | |
| static void | island_terrain_free () |
| Free memory allocated for terrain selection lists. More... | |
| static void | initworld (struct gen234_state *pstate) |
| fill ocean and make polar A temperature map is created in map_fractal_generate(). More... | |
| static bool | map_generate_island_variable () |
| island base map generators More... | |
| static bool | map_generate_island_single () |
| On popular demand, this tries to mimick the generator 3 as best as possible. More... | |
| static bool | map_generate_island_2or3 () |
| Generator for placing a couple of players to each island. More... | |
| bool | map_generate_island () |
| Generate a map with the ISLAND family of generators. More... | |
| static struct tile * | get_random_map_position_from_state (const struct gen234_state *const pstate) |
| Returns a random position in the rectangle denoted by the given state. More... | |
| static bool | island_river_mouth_suitability (const struct tile *ptile, const struct extra_type *priver) |
| Returns TRUE if ptile is suitable for a river mouth. More... | |
| static bool | island_river_suitability (const struct tile *ptile, const struct extra_type *priver) |
| Returns TRUE if there is a river in a cardinal direction near the tile and the tile is suitable for extending it. More... | |
| static bool | is_near_land (struct tile *ptile) |
| Return TRUE if the ocean position is near land. More... | |
| static bool | place_island (struct gen234_state *pstate) |
| Finds a place and drop the island created when called with islemass != 0. More... | |
| static int | count_card_adjc_elevated_tiles (struct tile *ptile) |
| Returns the number of cardinally adjacent tiles have a non-zero elevation. More... | |
Variables | |
| struct { | |
| bool init | |
| struct terrain_select_list * forest | |
| struct terrain_select_list * desert | |
| struct terrain_select_list * mountain | |
| struct terrain_select_list * swamp | |
| } | island_terrain = {.init = false} |
| static long int | checkmass |
| #define DMSIS 10 |
Definition at line 303 of file islands.cpp.
| #define SPECLIST_TAG terrain_select |
Definition at line 40 of file islands.cpp.
| #define terrain_select_list_iterate | ( | tersel_list, | |
| ptersel | |||
| ) | TYPED_LIST_ITERATE(struct terrain_select, tersel_list, ptersel) |
Definition at line 43 of file islands.cpp.
| #define terrain_select_list_iterate_end LIST_ITERATE_END |
Definition at line 45 of file islands.cpp.
|
static |
Returns the number of cardinally adjacent tiles have a non-zero elevation.
Definition at line 922 of file islands.cpp.
Referenced by create_island().
|
static |
finds a place and drop the island created when called with islemass != 0
Definition at line 940 of file islands.cpp.
Referenced by make_island().
|
static |
Fill an island with different types of terrains; rivers have extra code.
Definition at line 658 of file islands.cpp.
Referenced by make_island().
|
static |
Fill an island with rivers.
Definition at line 779 of file islands.cpp.
Referenced by make_island().
|
static |
Returns a random position in the rectangle denoted by the given state.
Definition at line 609 of file islands.cpp.
Referenced by create_island(), fill_island(), and fill_island_rivers().
|
static |
fill ocean and make polar A temperature map is created in map_fractal_generate().
Definition at line 268 of file islands.cpp.
Referenced by map_generate_island_2or3(), map_generate_island_single(), and map_generate_island_variable().
|
static |
Return TRUE if the ocean position is near land.
This is used in the creation of islands, so it differs logically from near_safe_tiles().
Definition at line 835 of file islands.cpp.
Referenced by place_island().
|
static |
Returns TRUE if ptile is suitable for a river mouth.
Definition at line 739 of file islands.cpp.
Referenced by fill_island_rivers().
|
static |
Returns TRUE if there is a river in a cardinal direction near the tile and the tile is suitable for extending it.
Definition at line 757 of file islands.cpp.
Referenced by fill_island_rivers().
|
static |
Free memory allocated for terrain selection lists.
Definition at line 136 of file islands.cpp.
Referenced by map_generate_island().
|
static |
Initialize terrain selection lists for make_island().
Definition at line 80 of file islands.cpp.
Referenced by map_generate_island().
|
static |
make an island, fill every tile type except plains note: you have to create big islands first.
Return TRUE if successful. min_specific_island_size is a percent value.
Definition at line 156 of file islands.cpp.
Referenced by initworld(), map_generate_island_2or3(), map_generate_island_single(), and map_generate_island_variable().
| bool map_generate_island | ( | ) |
Generate a map with the ISLAND family of generators.
Returns true on success.
Definition at line 574 of file islands.cpp.
Referenced by map_generate().
|
static |
Generator for placing a couple of players to each island.
PS: The weights NEED to sum up to totalweight (dammit)
Definition at line 505 of file islands.cpp.
Referenced by map_generate_island().
|
static |
On popular demand, this tries to mimick the generator 3 as best as possible.
PS: I'd like to mult by 3/2, but starters might make trouble then
Definition at line 405 of file islands.cpp.
Referenced by map_generate_island().
|
static |
island base map generators
Definition at line 308 of file islands.cpp.
Referenced by map_generate_island().
|
static |
Finds a place and drop the island created when called with islemass != 0.
Definition at line 852 of file islands.cpp.
Referenced by create_island().
|
static |
Free resources allocated for terrain_select structure.
Definition at line 649 of file islands.cpp.
Referenced by island_terrain_init().
|
static |
Allocate and initialize new terrain_select structure.
Definition at line 627 of file islands.cpp.
Referenced by island_terrain_init().
|
static |
Definition at line 75 of file islands.cpp.
Referenced by make_island(), map_generate_island_2or3(), map_generate_island_single(), map_generate_island_variable(), and place_island().
| struct terrain_select_list* desert |
Definition at line 59 of file islands.cpp.
| struct terrain_select_list* forest |
Definition at line 58 of file islands.cpp.
| bool init |
Definition at line 57 of file islands.cpp.
| struct { ... } island_terrain |
Referenced by island_terrain_free(), island_terrain_init(), and make_island().
| struct terrain_select_list* mountain |
Definition at line 60 of file islands.cpp.
| struct terrain_select_list* swamp |
Definition at line 61 of file islands.cpp.