Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/generator/fracture_map.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Data Structures | Functions | Variables
fracture_map.c File Reference
`#include "rand.h"`
`#include "map.h"`
`#include "height_map.h"`
`#include "mapgen_topology.h"`
`#include "mapgen_utils.h"`
`#include "fracture_map.h"`

Go to the source code of this file.

## Data Structures

struct | map_point
struct | map_landmass

## Functions

static void | circle_bresenham (int xc, int yc, int r, int nn)
static void | fmfill (int x, int y, int c, int r)
static int | local_ave_elevation (struct tile *ptile)
void | make_fracture_map (void)
void | make_fracture_relief (void)

## Variables

int * | height_map
int | num_landmass = 50
static map_landmass * | landmass
static map_point * | fracture_points

## Function Documentation

## ◆ circle_bresenham()

static void circle_bresenham | ( | int | xc,
|  | int | yc,
|  | int | r,
|  | int | nn
| ) |  |

static

An expanding circle from the fracture point is used to determine the midpoint between fractures. The cells must be assigned to landmasses anyway.

Definition at line 148 of file fracture_map.c.

Referenced by make_fracture_map().

## ◆ fmfill()

static void fmfill | ( | int | x,
|  | int | y,
|  | int | c,
|  | int | r
| ) |  |

static

Assign landmass in 3x3 area increments to avoid "holes" created by the circle algorithm.

Definition at line 179 of file fracture_map.c.

Referenced by circle_bresenham().

## ◆ local_ave_elevation()

static int local_ave_elevation | ( | struct tile * | ptile | ) |

static

Determine the local average elevation. Used to determine where hills and mountains are.

Definition at line 266 of file fracture_map.c.

Referenced by make_fracture_relief().

## ◆ make_fracture_map()

void make_fracture_map | ( | void |  | ) |

Fracture map generator

Definition at line 55 of file fracture_map.c.

Referenced by map_fractal_generate().

## ◆ make_fracture_relief()

void make_fracture_relief | ( | void |  | ) |

make_fracture_relief() Goes through a couple of iterations. The first iteration chooses mountains and hills based on how much the tile exceeds the elevation of the surrounding tiles. This will typically causes hills and mountains to be placed along the edges of landmasses. It can generate mountain ranges where there a differences in elevation between landmasses.

Definition at line 292 of file fracture_map.c.

Referenced by make_land().

## Variable Documentation

## ◆ fracture_points

map_point* fracture_points

static

Definition at line 50 of file fracture_map.c.

Referenced by make_fracture_map().

## ◆ height_map

int* height_map

extern

Definition at line 29 of file height_map.c.

Referenced by create_island(), initworld(), make_fracture_map(), map_fractal_generate(), mapgenerator2(), mapgenerator3(), and mapgenerator4().

## ◆ landmass

map_landmass* landmass

static

Definition at line 49 of file fracture_map.c.

Referenced by fmfill(), make_fracture_map(), and mapgenerator3().

## ◆ num_landmass

int num_landmass = 50

Definition at line 35 of file fracture_map.c.

Referenced by make_fracture_map().