Project

General

Profile

Feature #437 ยป 0049-generator-Clear-trailing-spaces.patch

Marko Lindqvist, 04/11/2024 06:02 AM

View differences:

server/generator/fracture_map.c
}
}
/* Assign cells to landmass. Gradually expand the radius of the
/* Assign cells to landmass. Gradually expand the radius of the
fracture point. */
for (rad = 1; rad < (MAP_NATIVE_WIDTH >> 1); rad++) {
for (nn = 0; nn < mm + num_landmass; nn++) {
......
**************************************************************************/
static void circle_bresenham(int xc, int yc, int r, int nn)
{
int x = 0;
int y = r;
int x = 0;
int y = r;
int p = 3 - 2 * r;
if (!r) {
server/generator/mapgen_topology.c
const int even = 2;
/* In iso-maps we need to double the map.ysize factor, since xsize is
* in native coordinates which are compressed 2x in the X direction. */
* in native coordinates which are compressed 2x in the X direction. */
const int iso = MAP_IS_ISOMETRIC ? 2 : 1;
/* We have:
......
*
* 1000 * size = i_size * i_size * xratio * yratio * even * even * iso
* i_size = sqrt(1000 * size / (xratio * yratio * even * even * iso))
*
*
* Make sure to round off i_size to preserve exact wanted ratios,
* that may be importante for some topologies.
*/
......
/* If the ratio is too big for some topology the simplest way to avoid
* this error is to set the maximum size smaller for all topologies! */
if (wld.map.server.size * 1000 > size + 900.0) {
/* Warning when size is set uselessly big */
/* Warning when size is set uselessly big */
log_error("Requested size of %d is too big for this topology.",
wld.map.server.size);
}
server/generator/mapgen_topology.h
int get_sqsize(void);
/* Size safe Unit of colatitude. 0 is not allowed due to possibility of
* division by 0 in mapgen.c */
* 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:
server/generator/mapgen_utils.c
/**********************************************************************//**
Set all oceanics tiles in placed_map
**************************************************************************/
void set_all_ocean_tiles_placed(void)
void set_all_ocean_tiles_placed(void)
{
whole_map_iterate(&(wld.map), ptile) {
if (is_ocean_tile(ptile)) {
......
}
/**********************************************************************//**
Set all nearby tiles as placed on pmap.
Set all nearby tiles as placed on pmap.
**************************************************************************/
void set_placed_near_pos(struct tile *ptile, int dist)
{
......
/* create the linearize function as "incremental" frequencies */
for (i = 0; i < size; i++) {
count += frequencies[i];
count += frequencies[i];
frequencies[i] = int_map_min + (count * int_map_delta) / total;
}
......
Return size in tiles of the given ocean. You should use positive ocean
number.
**************************************************************************/
int get_ocean_size(Continent_id id)
int get_ocean_size(Continent_id id)
{
fc_assert_ret_val(id > 0, -1);
return ocean_sizes[id];
server/generator/mapgen_utils.h
#define axis_iterate_end \
} \
} \
}
}
/***************************************************************************
pdata or pfilter can be NULL!
......
void set_all_ocean_tiles_placed(void) ;
void set_placed_near_pos(struct tile *ptile, int dist);
#endif /* FC__MAPGEN_UTILS_H */
#endif /* FC__MAPGEN_UTILS_H */
server/generator/startpos.c
MAPSTARTPOS_2or3: 2 players per isle (maybe one isle with 3).
MAPSTARTPOS_ALL: all players in asingle isle.
MAPSTARTPOS_VARIABLE: at least 2 player per isle.
Assumes assign_continent_numbers() has already been done!
Returns true on success
****************************************************************************/
......
int min_goodies_per_player = 1500;
int total_goodies = 0;
/* This is factor is used to maximize land used in extreme little maps */
float efactor = player_count() / map_size_checked() / 4;
float efactor = player_count() / map_size_checked() / 4;
bool failure = FALSE;
bool is_tmap = temperature_is_initialized();
const struct civ_map *nmap = &(wld.map);
......
/* the variable way is the last possibility */
if (MAPSTARTPOS_VARIABLE == mode) {
min_goodies_per_player = total_goodies * (0.65 + 0.8 * efactor)
min_goodies_per_player = total_goodies * (0.65 + 0.8 * efactor)
/ (1 + efactor) / player_count();
}
{
{
int nr, to_place = player_count(), first = 1;
/* inizialize islands_index */
server/generator/temperature_map.c
/**********************************************************************//**
Return true if at least one tile has tt temperature type
**************************************************************************/
bool is_temperature_type_near(const struct tile *ptile, temperature_type tt)
bool is_temperature_type_near(const struct tile *ptile, temperature_type tt)
{
adjc_iterate(&(wld.map), ptile, tile1) {
if (BOOL_VAL(tmap(tile1) & (tt))) {
    (1-1/1)