Freeciv21
Develop your civilization from humble roots to a global empire
fracture_map.cpp File Reference
#include "rand.h"
#include "map.h"
#include "height_map.h"
#include "mapgen_topology.h"
#include "mapgen_utils.h"
#include "fracture_map.h"
+ Include dependency graph for fracture_map.cpp:

Go to the source code of this file.

Classes

struct  map_point
 
struct  map_landmass
 

Functions

static void circle_bresenham (int xc, int yc, int r, int nn)
 An expanding circle from the fracture point is used to determine the midpoint between fractures. More...
 
static void fmfill (int x, int y, int c, int r)
 Assign landmass in 3x3 area increments to avoid "holes" created by the circle algorithm. More...
 
static int local_ave_elevation (struct tile *ptile)
 Determine the local average elevation. More...
 
void make_fracture_hmap ()
 Fracture map generator. More...
 
void make_fracture_relief ()
 make_fracture_relief() Goes through a couple of iterations. More...
 

Variables

int num_landmass = 50
 
static map_landmasslandmass
 
static map_pointfracture_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 167 of file fracture_map.cpp.

Referenced by make_fracture_hmap().

◆ 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 198 of file fracture_map.cpp.

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 285 of file fracture_map.cpp.

Referenced by make_fracture_relief().

◆ make_fracture_hmap()

void make_fracture_hmap ( )

Fracture map generator.

Definition at line 51 of file fracture_map.cpp.

Referenced by map_generate().

◆ make_fracture_relief()

void make_fracture_relief ( )

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 311 of file fracture_map.cpp.

Referenced by make_land().

Variable Documentation

◆ fracture_points

map_point* fracture_points
static

Definition at line 46 of file fracture_map.cpp.

Referenced by make_fracture_hmap().

◆ landmass

map_landmass* landmass
static

Definition at line 45 of file fracture_map.cpp.

Referenced by fmfill(), make_fracture_hmap(), and map_generate_island_single().

◆ num_landmass

int num_landmass = 50

Definition at line 30 of file fracture_map.cpp.

Referenced by make_fracture_hmap().