Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

world.c File Reference

#include "conq.h"
#include "kernel.h"
#include <math.h>

Include dependency graph for world.c:

Include dependency graph

Defines

#define MINUTES   (21600)

Functions

void init_world (void)
int set_world_circumference (int circum, int warn)
int set_area_shape (int width, int height, int warn)
int valid_area_shape (int width, int height, int warn)
void check_area_shape (void)
void calculate_world_globals (void)
void final_init_world (void)
void compute_elevation_bounds (void)
void allocate_area_terrain (void)
void allocate_area_aux_terrain (int t)
void allocate_area_scratch (int n)
void allocate_area_elevations (void)
void allocate_area_temperatures (void)
void allocate_area_people_sides (void)
void allocate_area_control_sides (void)
void allocate_area_material (int m)
void allocate_area_clouds (void)
void allocate_area_cloud_altitudes (void)
void allocate_area_cloud_bottoms (void)
void allocate_area_cloud_heights (void)
void allocate_area_winds (void)
void allocate_area_users (void)
int fn_terrain_at (int x, int y)
int fn_aux_terrain_at (int x, int y)
int fn_feature_at (int x, int y)
int fn_elevation_at (int x, int y)
int fn_people_side_at (int x, int y)
int fn_control_side_at (int x, int y)
int fn_user_at (int x, int y)
int fn_material_at (int x, int y)
int fn_temperature_at (int x, int y)
int fn_raw_cloud_at (int x, int y)
int fn_raw_cloud_bottom_at (int x, int y)
int fn_raw_cloud_height_at (int x, int y)
int fn_raw_wind_at (int x, int y)
void fn_set_terrain_at (int x, int y, int val)
void fn_set_aux_terrain_at (int x, int y, int val)
void fn_set_people_side_at (int x, int y, int val)
void fn_set_control_side_at (int x, int y, int val)
void fn_set_user_at (int x, int y, int val)
void fn_set_raw_feature_at (int x, int y, int val)
void fn_set_elevation_at (int x, int y, int val)
void fn_set_material_at (int x, int y, int val)
void fn_set_temperature_at (int x, int y, int val)
void fn_set_raw_wind_at (int x, int y, int val)
void fn_set_raw_cloud_at (int x, int y, int val)
void fn_set_raw_cloud_bottom_at (int x, int y, int val)
void fn_set_raw_cloud_height_at (int x, int y, int val)
void change_terrain_type (int x, int y, int t2)
int limited_search_around (int x0, int y0, int range, int(*pred)(int, int, int *, ParamBox *), int incr, int *counter, int rsltlimit, ParamBox *parambox)
int search_around (int x0, int y0, int range, int(*pred)(int, int, int *, ParamBox *), int incr, ParamBox *parambox)
int search_around (int x0, int y0, int maxdist, int(*pred)(int, int), int *rxp, int *ryp, int incr)
int limited_search_around (int x0, int y0, int maxdist, int(*pred)(int, int, int *), int *rxp, int *ryp, int incr, int rsltlimit)
int search_and_apply (int x0, int y0, int maxdist, int(*pred)(int, int), int *rxp, int *ryp, int incr, void(*fn)(int, int), int num)
void apply_to_area (int x0, int y0, int dist, void(*fn)(int, int))
void apply_to_area_plus_edge (int x0, int y0, int dist, void(*fn)(int, int))
void apply_to_ring (int x0, int y0, int distmin, int distmax, void(*fn)(int, int))
void apply_to_hexagon (int x0, int y0, int w2, int h2, void(*fn)(int, int))
int limited_search_under_arc (int x, int y, int dir, int range, int dirbias, int(*pred)(int x, int y, int *counter, ParamBox *parambox), int *counter, int rsltlimit, ParamBox *parambox)
int search_under_arc (int x, int y, int dir, int range, int dirbias, int(*pred)(int x, int y, int *counter, ParamBox *parambox), ParamBox *parambox)
void apply_to_path (int fx, int fy, int tx, int ty, int(*dirtest)(int x, int y, int dir), int(*dirsort)(int x, int y, int *dirchoices, int numchoices), int(*fn)(int x, int y, int dir, int j, int numchoices), int shortest)
int search_straight_line (int x0, int y0, int x1, int y1, int(*pred)(int, int), int *rxp, int *ryp)
void set_border_at (int x, int y, int dir, int t, int onoff)
void set_connection_at (int x, int y, int dir, int t, int onoff)
void patch_linear_terrain (int t)
void init_features (void)
Featurecreate_feature (char *feattype, char *name)
Featurefind_feature (int fid)
Featurefeature_at (int x, int y)
void set_feature_type_name (Feature *feature, char *feattype)
void set_feature_name (Feature *feature, char *name)
void destroy_feature (Feature *feature)
void renumber_features (void)
void compute_all_feature_centroids (void)
void compute_feature_centroid (Feature *feature)
int num_people_at (int x, int y)
int point_in_dir (int x, int y, int dir, int *xp, int *yp)
int interior_point_in_dir (int x, int y, int dir, int *xp, int *yp)
int point_in_dir_n (int x, int y, int dir, int n, int *xp, int *yp)
int interior_point_in_dir_n (int x, int y, int dir, int n, int *xp, int *yp)
int random_point (int *xp, int *yp)
int random_edge_point (int *xp, int *yp)
int random_point_near (int cx, int cy, int radius, int *xp, int *yp)
int random_point_in_area (int cx, int cy, int rx, int ry, int *xp, int *yp)
void terrain_subtype_warning (char *context, int t)
int approx_dir (int dx, int dy)
int distance (int x1, int y1, int x2, int y2)
int world_distance (int x1, int y1, int x2, int y2)
int closest_dir (int x, int y)
void xy_to_latlong (int x, int y, int xf, int yf, int *latp, int *lonp)
int latlong_to_xy (int lat, int lon, int *xp, int *yp, int *xfp, int *yfp)
void add_neighbor (TRegion *reg1, TRegion *reg2)
int region_value (int x, int y, int landsea)
void divide_into_regions (char *tlayer, TRegion **rlayer, int landsea)
void fix_elevations (void)
void paint_cell (Side *side, int x, int y, int r, int t)
void paint_border (Side *side, int x, int y, int dir, int t, int mode)
void paint_connection (Side *side, int x, int y, int dir, int t, int mode)
void paint_coating (Side *side, int x, int y, int r, int t, int depth)
void paint_people (Side *side, int x, int y, int r, int s)
void paint_control (Side *side, int x, int y, int r, int s)
void paint_feature (Side *side, int x, int y, int r, int f)
void paint_elevation (Side *side, int x, int y, int r, int code, int elev, int vary)
void paint_temperature (Side *side, int x, int y, int r, int temp)
void paint_material (Side *side, int x, int y, int r, int m, int amt)
void paint_clouds (Side *side, int x, int y, int r, int cloudtype, int bot, int hgt)
void paint_winds (Side *side, int x, int y, int r, int dir, int force)
void toggle_user_at (Unit *unit, int x, int y)

Variables

World world
Area area
Featurefeaturelist = NULL
 Feature list.

Featurelast_feature = NULL
int nextfid = 1
int numfeatures
int minelev
int maxelev
int any_elev_variation = FALSE
int mintemp
int maxtemp
int any_temp_variation = FALSE
int any_temp_variation_in_layer = FALSE
int minwindforce
int maxwindforce
int any_wind_variation = FALSE
int any_wind_variation_in_layer = FALSE
int any_clouds = FALSE
int minclouds
int maxclouds
int any_materials_in_terrain = FALSE
TRegionterrain_region_list
TRegionlandsea_region_list
int num_terrain_regions
int num_landsea_regions
int stop_apply

Define Documentation

#define MINUTES   (21600)
 


Function Documentation

void add_neighbor TRegion reg1,
TRegion reg2
 

void allocate_area_aux_terrain int  t  ) 
 

void allocate_area_cloud_altitudes void   ) 
 

void allocate_area_cloud_bottoms void   ) 
 

void allocate_area_cloud_heights void   ) 
 

void allocate_area_clouds void   ) 
 

void allocate_area_control_sides void   ) 
 

void allocate_area_elevations void   ) 
 

void allocate_area_material int  m  ) 
 

void allocate_area_people_sides void   ) 
 

void allocate_area_scratch int  n  ) 
 

void allocate_area_temperatures void   ) 
 

void allocate_area_terrain void   ) 
 

void allocate_area_users void   ) 
 

void allocate_area_winds void   ) 
 

void apply_to_area int  x0,
int  y0,
int  dist,
void(*  fn)(int, int)
 

void apply_to_area_plus_edge int  x0,
int  y0,
int  dist,
void(*  fn)(int, int)
 

void apply_to_hexagon int  x0,
int  y0,
int  w2,
int  h2,
void(*  fn)(int, int)
 

void apply_to_path int  fx,
int  fy,
int  tx,
int  ty,
int(*  dirtest)(int x, int y, int dir),
int(*  dirsort)(int x, int y, int *dirchoices, int numchoices),
int(*  fn)(int x, int y, int dir, int j, int numchoices),
int  shortest
 

void apply_to_ring int  x0,
int  y0,
int  distmin,
int  distmax,
void(*  fn)(int, int)
 

int approx_dir int  dx,
int  dy
 

void calculate_world_globals void   ) 
 

void change_terrain_type int  x,
int  y,
int  t2
 

void check_area_shape void   ) 
 

int closest_dir int  x,
int  y
 

void compute_all_feature_centroids void   ) 
 

void compute_elevation_bounds void   ) 
 

void compute_feature_centroid Feature feature  ) 
 

Feature* create_feature char *  feattype,
char *  name
 

void destroy_feature Feature feature  ) 
 

int distance int  x1,
int  y1,
int  x2,
int  y2
 

void divide_into_regions char *  tlayer,
TRegion **  rlayer,
int  landsea
 

Feature* feature_at int  x,
int  y
 

void final_init_world void   ) 
 

Feature* find_feature int  fid  ) 
 

void fix_elevations void   ) 
 

int fn_aux_terrain_at int  x,
int  y
 

int fn_control_side_at int  x,
int  y
 

int fn_elevation_at int  x,
int  y
 

int fn_feature_at int  x,
int  y
 

int fn_material_at int  x,
int  y
 

int fn_people_side_at int  x,
int  y
 

int fn_raw_cloud_at int  x,
int  y
 

int fn_raw_cloud_bottom_at int  x,
int  y
 

int fn_raw_cloud_height_at int  x,
int  y
 

int fn_raw_wind_at int  x,
int  y
 

void fn_set_aux_terrain_at int  x,
int  y,
int  val
 

void fn_set_control_side_at int  x,
int  y,
int  val
 

void fn_set_elevation_at int  x,
int  y,
int  val
 

void fn_set_material_at int  x,
int  y,
int  val
 

void fn_set_people_side_at int  x,
int  y,
int  val
 

void fn_set_raw_cloud_at int  x,
int  y,
int  val
 

void fn_set_raw_cloud_bottom_at int  x,
int  y,
int  val
 

void fn_set_raw_cloud_height_at int  x,
int  y,
int  val
 

void fn_set_raw_feature_at int  x,
int  y,
int  val
 

void fn_set_raw_wind_at int  x,
int  y,
int  val
 

void fn_set_temperature_at int  x,
int  y,
int  val
 

void fn_set_terrain_at int  x,
int  y,
int  val
 

void fn_set_user_at int  x,
int  y,
int  val
 

int fn_temperature_at int  x,
int  y
 

int fn_terrain_at int  x,
int  y
 

int fn_user_at int  x,
int  y
 

void init_features void   ) 
 

void init_world void   ) 
 

int interior_point_in_dir int  x,
int  y,
int  dir,
int *  xp,
int *  yp
 

int interior_point_in_dir_n int  x,
int  y,
int  dir,
int  n,
int *  xp,
int *  yp
 

int latlong_to_xy int  lat,
int  lon,
int *  xp,
int *  yp,
int *  xfp,
int *  yfp
 

int limited_search_around int  x0,
int  y0,
int  maxdist,
int(*  pred)(int, int, int *),
int *  rxp,
int *  ryp,
int  incr,
int  rsltlimit
 

int limited_search_around int  x0,
int  y0,
int  range,
int(*  pred)(int, int, int *, ParamBox *),
int  incr,
int *  counter,
int  rsltlimit,
ParamBox parambox
 

int limited_search_under_arc int  x,
int  y,
int  dir,
int  range,
int  dirbias,
int(*  pred)(int x, int y, int *counter, ParamBox *parambox),
int *  counter,
int  rsltlimit,
ParamBox parambox
 

int num_people_at int  x,
int  y
 

void paint_border Side side,
int  x,
int  y,
int  dir,
int  t,
int  mode
 

void paint_cell Side side,
int  x,
int  y,
int  r,
int  t
 

void paint_clouds Side side,
int  x,
int  y,
int  r,
int  cloudtype,
int  bot,
int  hgt
 

void paint_coating Side side,
int  x,
int  y,
int  r,
int  t,
int  depth
 

void paint_connection Side side,
int  x,
int  y,
int  dir,
int  t,
int  mode
 

void paint_control Side side,
int  x,
int  y,
int  r,
int  s
 

void paint_elevation Side side,
int  x,
int  y,
int  r,
int  code,
int  elev,
int  vary
 

void paint_feature Side side,
int  x,
int  y,
int  r,
int  f
 

void paint_material Side side,
int  x,
int  y,
int  r,
int  m,
int  amt
 

void paint_people Side side,
int  x,
int  y,
int  r,
int  s
 

void paint_temperature Side side,
int  x,
int  y,
int  r,
int  temp
 

void paint_winds Side side,
int  x,
int  y,
int  r,
int  dir,
int  force
 

void patch_linear_terrain int  t  ) 
 

int point_in_dir int  x,
int  y,
int  dir,
int *  xp,
int *  yp
 

int point_in_dir_n int  x,
int  y,
int  dir,
int  n,
int *  xp,
int *  yp
 

int random_edge_point int *  xp,
int *  yp
 

int random_point int *  xp,
int *  yp
 

int random_point_in_area int  cx,
int  cy,
int  rx,
int  ry,
int *  xp,
int *  yp
 

int random_point_near int  cx,
int  cy,
int  radius,
int *  xp,
int *  yp
 

int region_value int  x,
int  y,
int  landsea
 

void renumber_features void   ) 
 

int search_and_apply int  x0,
int  y0,
int  maxdist,
int(*  pred)(int, int),
int *  rxp,
int *  ryp,
int  incr,
void(*  fn)(int, int),
int  num
 

int search_around int  x0,
int  y0,
int  maxdist,
int(*  pred)(int, int),
int *  rxp,
int *  ryp,
int  incr
 

int search_around int  x0,
int  y0,
int  range,
int(*  pred)(int, int, int *, ParamBox *),
int  incr,
ParamBox parambox
 

int search_straight_line int  x0,
int  y0,
int  x1,
int  y1,
int(*  pred)(int, int),
int *  rxp,
int *  ryp
 

int search_under_arc int  x,
int  y,
int  dir,
int  range,
int  dirbias,
int(*  pred)(int x, int y, int *counter, ParamBox *parambox),
ParamBox parambox
 

int set_area_shape int  width,
int  height,
int  warn
 

void set_border_at int  x,
int  y,
int  dir,
int  t,
int  onoff
 

void set_connection_at int  x,
int  y,
int  dir,
int  t,
int  onoff
 

void set_feature_name Feature feature,
char *  name
 

void set_feature_type_name Feature feature,
char *  feattype
 

int set_world_circumference int  circum,
int  warn
 

void terrain_subtype_warning char *  context,
int  t
 

void toggle_user_at Unit unit,
int  x,
int  y
 

int valid_area_shape int  width,
int  height,
int  warn
 

int world_distance int  x1,
int  y1,
int  x2,
int  y2
 

void xy_to_latlong int  x,
int  y,
int  xf,
int  yf,
int *  latp,
int *  lonp
 


Variable Documentation

int any_clouds = FALSE
 

Any clouds? ???

int any_elev_variation = FALSE
 

Any elevation variation? ???

int any_materials_in_terrain = FALSE
 

Any Materials in terrain? ???

int any_temp_variation = FALSE
 

Any temperture variation? ???

int any_temp_variation_in_layer = FALSE
 

Any temperature variation in layer? ???

int any_wind_variation = FALSE
 

Any wind variation? ???

int any_wind_variation_in_layer = FALSE
 

Any wind variation in layer? ???

Area area
 

Area global.

Feature* featurelist = NULL
 

Feature list.

TRegion* landsea_region_list
 

Feature* last_feature = NULL
 

int maxclouds
 

int maxelev
 

Maximum elevation.

int maxtemp
 

Maximum termperature.

int maxwindforce
 

Maximum windforce.

int minclouds
 

int minelev
 

Minimum elevation.

int mintemp
 

Minimum termperature.

int minwindforce
 

Minimum wind forces.

int nextfid = 1
 

int num_landsea_regions
 

int num_terrain_regions
 

int numfeatures
 

Number of features.

int stop_apply
 

TRegion* terrain_region_list
 

World world
 

World global.


Generated on Sat Sep 17 10:29:44 2005 for XconqKernel by doxygen 1.3.6