Feature #1185 » 0043-Fix-generator-comment-typos.patch
| server/generator/mapgen.c | ||
|---|---|---|
|
#define RIVERS_MAXTRIES 32767
|
||
|
/* This struct includes two dynamic bitvectors. They are needed to mark
|
||
|
tiles as blocked to prevent a river from falling into itself, and for
|
||
|
storing rivers temporarly. */
|
||
|
storing rivers temporarily. */
|
||
|
struct river_map {
|
||
|
struct dbv blocked;
|
||
|
struct dbv ok;
|
||
| ... | ... | |
|
FALSE, TRUE, TC_OCEAN) <= 35)
|
||
|
typedef enum { WC_ALL = 200, WC_DRY, WC_NDRY } wetness_c;
|
||
|
/* MISCELANEOUS (OTHER CONDITIONS) */
|
||
|
/* MISCELLANEOUS (OTHER CONDITIONS) */
|
||
|
/* Necessary condition of swamp placement */
|
||
|
static int hmap_low_level = 0;
|
||
| ... | ... | |
|
}
|
||
|
/**********************************************************************//**
|
||
|
Make_terrains calls make_forest, make_dessert,etc with random free
|
||
|
Make_terrains calls make_forest(), make_dessert(), etc with random free
|
||
|
locations until there has been made enough.
|
||
|
Comment: funtions as make_swamp, etc. has to have a non 0 probability
|
||
|
to place one terrains in called position. Else make_terrains will get
|
||
|
Comment: functions as make_swamp(), etc. has to have a non zero probability
|
||
|
to place one terrains in called position. Else make_terrains() will get
|
||
|
in a infinite loop!
|
||
|
**************************************************************************/
|
||
|
static void make_terrains(void)
|
||
| ... | ... | |
|
n: height_map[...]
|
||
|
If these rules haven't decided the direction, the random number
|
||
|
generator gets the desicion. -Erik Sigra
|
||
|
generator gets the decision. -Erik Sigra
|
||
|
**************************************************************************/
|
||
|
static bool make_river(struct river_map *privermap, struct tile *ptile,
|
||
|
struct extra_type *priver)
|
||
| ... | ... | |
|
} else {
|
||
|
make_relief(); /* Base relief on map */
|
||
|
}
|
||
|
make_terrains(); /* Place all exept mountains and hill */
|
||
|
make_terrains(); /* Place all except mountains and hill */
|
||
|
destroy_placed_map();
|
||
|
make_rivers(); /* Use a new placed_map. Destroy older before call */
|
||
| ... | ... | |
|
}
|
||
|
/**********************************************************************//**
|
||
|
On popular demand, this tries to mimick the generator 3 as best as
|
||
|
On popular demand, this tries to mimic the generator 3 as best as
|
||
|
possible.
|
||
|
**************************************************************************/
|
||
|
static void mapgenerator3(void)
|
||
| server/generator/mapgen_topology.h | ||
|---|---|---|
|
* division by 0 in mapgen.c */
|
||
|
#define L_UNIT MAX(1, wld.map.server.size * MAX_COLATITUDE / (30 * get_sqsize()))
|
||
|
/* define the 3 regions of a Earth like map:
|
||
|
/* Define the 3 regions of a Earth like map:
|
||
|
0 - COLD_LV: cold region
|
||
|
COLD_LV - TREOPICAL_LV: temperate wet region
|
||
|
TROPICAL_LV - MAX_COLATITUDE: tropical wet region
|
||
|
and a dry region, this last one can ovelap others
|
||
|
DRY_MIN_LEVEL- DRY_MAX_LEVEL */
|
||
|
and a dry region, this last one can overlap others
|
||
|
DRY_MIN_LEVEL - DRY_MAX_LEVEL */
|
||
|
#define COLD_LEVEL \
|
||
|
(MAX(0, MAX_COLATITUDE * (60*7 - wld.map.server.temperature * 6 ) / 700))
|
||
|
#define TROPICAL_LEVEL \
|
||
| ... | ... | |
|
#define DRY_MAX_LEVEL \
|
||
|
(MAX_COLATITUDE * (7300 + wld.map.server.temperature * 17 ) / 10000)
|
||
|
/* used to create the poles and for separating them. In a
|
||
|
/* Used to create the poles and for separating them. In a
|
||
|
* mercator projection map we don't want the poles to be too big. */
|
||
|
extern int ice_base_colatitude;
|
||
|
#define ICE_BASE_LEVEL ice_base_colatitude
|
||
| ... | ... | |
|
bool near_singularity(const struct tile *ptile);
|
||
|
void generator_init_topology(bool autosize);
|
||
|
#endif /* FC__MAPGEN_TOPOLOGY_H */
|
||
|
#endif /* FC__MAPGEN_TOPOLOGY_H */
|
||
| server/generator/startpos.c | ||
|---|---|---|
|
{
|
||
|
int nr, to_place = player_count(), first = 1;
|
||
|
/* inizialize islands_index */
|
||
|
/* Initialize islands_index */
|
||
|
for (nr = 1; nr <= wld.map.num_continents; nr++) {
|
||
|
islands_index[islands[nr].id] = nr;
|
||
|
}
|
||