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

world.h File Reference

Dfinitions relating to worlds and areas in Xconq. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  a_world
 World. More...

struct  a_area
 Area. More...

struct  a_feature
 Feature. More...

struct  a_waypoint
 Waypoint. More...

struct  a_path
 Path. More...

struct  a_region
 Region. More...

struct  a_region_link

Defines

#define MINWIDTH   3
 Minimum Area width.

#define MINHEIGHT   3
 Minimum Area height.

#define malloc_area_layer(TYPE)   ((TYPE *) xmalloc(area.width * area.height * sizeof(TYPE)))
 Allocate layer.

#define zero_area_layer(ADDR, TYPE)   (memset(ADDR, 0, area.width * area.height * sizeof(TYPE)))
 Zero area.

#define aref(m, x, y)   (in_area((x),(y)) ? (m)[area.width * (y) + wrapx((x))] : 0)
 Area refernce.

#define aset(m, x, y, v)   (in_area((x),(y)) ? (m)[area.width * (y) + wrapx((x))] = (v) : 0)
 Area set.

#define aadd(m, x, y, v)   (in_area((x),(y)) ? (m)[area.width * (y) + wrapx((x))] += (v) : 0)
 Area add.

#define NOUSER   (0)
 No user id.

#define user_defined()   (area.user != NULL)
 Is user area defined?

#define user_at(x, y)   aref(area.user, x, y)
 User at?

#define set_user_at(x, y, u)   aset(area.user, x, y, u)
#define radius_covers_n_cells(dist)   (1 + (((dist) + 1) * (dist) * 3))
 Number of cells covered by a radius.

#define cell_is_within_range(x, y, n, x1, y1)
 Is cell in range?

#define cell_is_within_reach(u, x1, y1)   cell_is_within_range((u)->x, (u)->y, (u)->reach, (x1), (y1))
 Is cell in reach?

#define for_all_cells_within_range(x, y, n, x1, y1)
 Iterate over range.

#define for_all_cells_within_reach(u, x1, y1)   for_all_cells_within_range((u)->x, (u)->y, (u)->reach, (x1), (y1))
 Iterate over all cells in range.

#define unit_at(x, y)   aref(area.units, x, y)
 Unit at cell.

#define set_unit_at(x, y, u)   aset(area.units, x, y, u)
 Set unit at cell.

#define for_all_stack(x, y, var)   for ((var) = unit_at((x), (y)); (var) != NULL; (var) = (var)->nexthere)
 Iterate Unit stack.

#define for_all_stack_with_occs(x, y, var)
 Iterate Unit stack and occupants.

#define terrain_defined()   (area.terrain != NULL)
 Is Terrain defined.

#define terrain_at(x, y)   aref(area.terrain, x, y)
 Terrain at.

#define set_terrain_at(x, y, t)   aset(area.terrain, x, y, t)
 Set Terrain at.

#define any_aux_terrain_defined()   (area.auxterrain != NULL)
 Is any auxillary terrain defined?

#define aux_terrain_defined(at)   (any_aux_terrain_defined() && area.auxterrain[at] != NULL)
 Is kind of auxillary terrain defined?

#define aux_terrain_at(x, y, at)   aref(area.auxterrain[at], x, y)
 Auxillary Terrain at.

#define set_aux_terrain_at(x, y, at, v)   aset(area.auxterrain[at], x, y, v)
 Set auxillary Terrain at.

#define any_borders_at(x, y, b)   (aux_terrain_at(x, y, b) != 0)
 Are there borders at?

#define border_at(x, y, dir, b)   (aux_terrain_defined(b) ? (aux_terrain_at(x, y, b) & (1 << (dir))) : FALSE)
 Is Border in dirction at.

#define any_connections_at(x, y, c)   (aux_terrain_at(x, y, c) != 0)
 Are there connections at?

#define connection_at(x, y, dir, c)   (aux_terrain_defined(c) ? (aux_terrain_at(x, y, c) & (1 << (dir))) : FALSE)
 Is connection in dirction at.

#define elevations_defined()   (area.elevations != NULL)
 Are elevations defined?

#define elev_at(x, y)   aref(area.elevations, x, y)
 Elevation at.

#define set_elev_at(x, y, v)   aset(area.elevations, x, y, v)
 Set elevation at.

#define features_defined()   (area.features != NULL)
 Are features defined?

#define raw_feature_at(x, y)   aref(area.features, x, y)
 Raw feature at. Get the id fo the feature at cell(x,y). The "raw feature" is its "short" identifier.

#define set_raw_feature_at(x, y, f)   aset(area.features, x, y, f)
 Set raw feature at. Set the id fo the feature at cell(x,y). The "raw feature" is its "short" identifier.

#define people_sides_defined()   (area.peopleside != NULL)
 Population defined?

#define people_side_at(x, y)   aref(area.peopleside, x, y)
 Side of people at.

#define set_people_side_at(x, y, s)   aset(area.peopleside, x, y, s)
 Set Side of people at.

#define NOBODY   (60)
 Nobody.

#define populated(x, y)   (people_side_at(x,y) != NOBODY)
 Is populated?

#define control_sides_defined()   (area.controlside != NULL)
 Is Area control defined?

#define control_side_at(x, y)   aref(area.controlside, x, y)
 Controled by at.

#define set_control_side_at(x, y, s)   aset(area.controlside, x, y, s)
 Set controled by at.

#define NOCONTROL   (60)
#define controlled(x, y)   (control_side_at(x,y) != NOCONTROL)
 Is Controlled?

#define any_cell_materials_defined()   (area.materials != NULL)
 Are cell Materials defined?

#define cell_material_defined(m)   (area.materials[m] != NULL)
 Is this material defined in cells?

#define material_at(x, y, m)   aref(area.materials[m], x, y)
 Material at cell.

#define set_material_at(x, y, m, v)   aset(area.materials[m], x, y, v)
 Set Material at cell.

#define temperatures_defined()   (area.temperature != NULL)
 Is temperature defined?

#define temperature_at(x, y)   aref(area.temperature, x, y)
 Temperature at cell.

#define set_temperature_at(x, y, v)   aset(area.temperature, x, y, v)
 Set temperature at cell.

#define clouds_defined()   (area.clouds != NULL)
 Are clouds defined?

#define raw_cloud_at(x, y)   aref(area.clouds, x, y)
 Clouds at cell.

#define set_raw_cloud_at(x, y, v)   aset(area.clouds, x, y, v)
 Set clouds at cell.

#define cloud_bottoms_defined()   (area.cloudbottoms != NULL)
 Are cloud bottoms defined?

#define raw_cloud_bottom_at(x, y)   aref(area.cloudbottoms, x, y)
 Cloud bottom at cell.

#define set_raw_cloud_bottom_at(x, y, v)   aset(area.cloudbottoms, x, y, v)
 Set cloud bottoms at cell.

#define cloud_heights_defined()   (area.cloudheights != NULL)
 Are cloud tops defined?

#define raw_cloud_height_at(x, y)   aref(area.cloudheights, x, y)
 Cloud top at cell.

#define set_raw_cloud_height_at(x, y, v)   aset(area.cloudheights, x, y, v)
 Set cloud top at cell.

#define winds_defined()   (area.winds != NULL)
 Are winds defined?

#define raw_wind_at(x, y)   aref(area.winds, x, y)
 Raw wind at cell.

#define set_raw_wind_at(x, y, v)   aset(area.winds, x, y, v)
 Set raw wind at cell.

#define wind_dir(w)   ((w) & 0x07)
 Wind direction.

#define wind_force(w)   ((w) >> 3)
 Wind froce.

#define wind_dir_at(x, y)   (wind_dir(raw_wind_at(x, y)))
 Wind direction at.

#define wind_force_at(x, y)   (wind_force(raw_wind_at(x, y)))
 Wind force at.

#define set_wind_at(x, y, d, f)   (set_raw_wind_at(x, y, ((f) << 3) | (d)))
 Set wind at cell.

#define CALM   (0)
 Calm wind force.

#define tmp1_at(x, y)   aref(area.tmp1, x, y)
 Get scratch layer 1.

#define set_tmp1_at(x, y, v)   aset(area.tmp1, x, y, v)
 Set scratch layer 1.

#define tmp2_at(x, y)   aref(area.tmp2, x, y)
 Get scratch layer 2.

#define set_tmp2_at(x, y, v)   aset(area.tmp2, x, y, v)
 Set scratch layer 2.

#define tmp3_at(x, y)   aref(area.tmp3, x, y)
 Get scratch layer 3.

#define set_tmp3_at(x, y, v)   aset(area.tmp3, x, y, v)
 Set scratch layer 3.

#define wrapx(x)   (area.xwrap ? (((x) + (area.width << 8)) % area.width) : (x))
 Wrap x.

#define limity(y)   (max(0, min((y), (area.height-1))))
 Constrain y co-ordinate.

#define interior(y)   (max(1, min((y), (area.height-2))))
 Constrain y to inerior of world.

#define xy_in_dir(x, y, dir, nx, ny)   (nx) = wrapx((x) + dirx[dir]); (ny) = (y) + diry[dir];
 Coordinate in direction.

#define in_area(x, y)   (between(0, (y), area.height-1) && x_in_area(x, y))
 Is in area?

#define x_in_area(x, y)
 Is x in area?

#define inside_area(x, y)   (between(1, (y), area.height-2) && x_inside_area(x, y))
 Is valid unit position?

#define x_inside_area(x, y)
 Is x a valid unit postion?

#define for_all_cells(x, y)
 Iterate over all cells.

#define for_all_interior_cells(x, y)
 Iterate over all interior cells.

#define for_all_features(feat)   for ((feat) = featurelist; (feat) != NULL; (feat) = (feat)->next)
 Iterate through features.

#define lighting(x, y, snx, sny)
 Lighting at cell.

#define night_at(x, y)   (daynight && lighting((x), (y), (int) sunx, (int) suny) == 0)
 Night at cell?


Typedefs

typedef a_world World
 World.

typedef a_area Area
 Area.

typedef a_feature Feature
 Feature.

typedef a_waypoint Waypoint
 Waypoint.

typedef a_path Path
 Path.

typedef a_region TRegion
 Region.

typedef a_region_link TRegionLink

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)
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_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 allocate_area_users (void)
int fn_user_at (int x, int y)
void fn_set_user_at (int x, int y, int val)
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_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)
Featurefind_feature (int fid)
Featurefeature_at (int x, int y)
void compute_all_feature_centroids (void)
void compute_feature_centroid (Feature *feature)
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 hextant (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)
int num_people_at (int x, int y)

Variables

World world
Area area
int midturnrestore
int numfeatures
int minelev
int maxelev
int mintemp
int maxtemp
int minwindforce
int maxwindforce
int any_materials_in_terrain
int any_elev_variation
int any_temp_variation
int any_temp_variation_in_layer
int any_wind_variation
int any_wind_variation_in_layer
int any_clouds


Detailed Description

Dfinitions relating to worlds and areas in Xconq.


Define Documentation

#define aadd m,
x,
y,
 )     (in_area((x),(y)) ? (m)[area.width * (y) + wrapx((x))] += (v) : 0)
 

Area add.

Increment the value of a cell in a layer.

Parameters:
m is a memory pointer to the start of a layer.
x is the x co-ordinate of the cell.
y is the y co-ordinate of the cell.
v is the value to add to the cell.
Returns:
the new value of the cell. : aadd now wraps x.

 
#define any_aux_terrain_defined  )     (area.auxterrain != NULL)
 

Is any auxillary terrain defined?

Check to see if there is any auxillary terrain defined.

Returns:
  • TRUE if area.auxterrain is not NULL;
  • FALSE otherwise.

#define any_borders_at x,
y,
 )     (aux_terrain_at(x, y, b) != 0)
 

Are there borders at?

Check for a border at a given cell.

Todo:
Not really correct, should finish.
See also:
aux_terrain_at.
Parameters:
x is the x location.
y is the y location.
b is the border Terrain type.
Returns:
  • TRUE if the border value at cell(x,y) is non-zero;
  • FALSE otherwise.

 
#define any_cell_materials_defined  )     (area.materials != NULL)
 

Are cell Materials defined?

Check to see if materials in cells are used.

Returns:
  • TRUE if area.materials is not NULL;
  • FALSE otherwise.

#define any_connections_at x,
y,
 )     (aux_terrain_at(x, y, c) != 0)
 

Are there connections at?

Check for a connections at a given cell.

See also:
aux_terrain_at.
Parameters:
x is the x location.
y is the y location.
c is the connections Terrain type.
Returns:
  • TRUE if the connection value at cell(x,y) is non-zero;
  • FALSE otherwise.

#define aref m,
x,
 )     (in_area((x),(y)) ? (m)[area.width * (y) + wrapx((x))] : 0)
 

Area refernce.

Returns a value at a cell in the layer.

Parameters:
m is a memory pointer to the start of a layer.
x is the x co-ordinate of the cell.
y is the y co-ordinate of the cell.
Returns:
the value of the cell. : aref now wraps x.

#define aset m,
x,
y,
 )     (in_area((x),(y)) ? (m)[area.width * (y) + wrapx((x))] = (v) : 0)
 

Area set.

Set the value of a cell in a layer.

Parameters:
m is a memory pointer to the start of a layer.
x is the x co-ordinate of the cell.
y is the y co-ordinate of the cell.
v is the new value of the cell.
Returns:
the new value of the cell. : aset now wraps x.

#define aux_terrain_at x,
y,
at   )     aref(area.auxterrain[at], x, y)
 

Auxillary Terrain at.

Get the auxillary terrain at a cell.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
at is the auxillary Terrain type.
Returns:
the auxillary Terrain type at cell(x,y).

#define aux_terrain_defined at   )     (any_aux_terrain_defined() && area.auxterrain[at] != NULL)
 

Is kind of auxillary terrain defined?

Check to see if a specific type of auxillary terrain is defined.

See also:
any_aux_terrain_defined.
Parameters:
at is the auxillary Terrain type.
Returns:

#define border_at x,
y,
dir,
 )     (aux_terrain_defined(b) ? (aux_terrain_at(x, y, b) & (1 << (dir))) : FALSE)
 

Is Border in dirction at.

See if there is a border in the specified direction at cell(x,y) for the specified border type.

See also:
aux_terrain_at.
Parameters:
x is the x location.
y is the y location.
dir is the direction to check.
b is the border Terrain type.
Returns:
  • TRUE if the cell(x,y) has a border in a particular direction;
  • FALSE otherwise.

#define CALM   (0)
 

Calm wind force.

#define cell_is_within_range x,
y,
n,
x1,
y1   ) 
 

Value:

(( (x) - (x1) > (n) || (x1) - (x) > (n) || (y) - (y1) > (n) \
        || (y1) - (y) > (n) || (x) + (y) - (x1) - (y1) > (n) \
        || (x1) + (y1) - (x) - (y) > (n) ) ? FALSE : TRUE)
Is cell in range?

Test if cell at (x1, y1) is within n steps from (x, y)

Parameters:
x is starting x location.
y is starting y location.
n is the range.
x1 is the ending x location.
y1 is the ending y location.
Returns:
TRUE if (x1,y1) is within n units of (x,y).

#define cell_is_within_reach u,
x1,
y1   )     cell_is_within_range((u)->x, (u)->y, (u)->reach, (x1), (y1))
 

Is cell in reach?

Test if cell at (x1, y1) is within reach of .

Parameters:
u is a pointer to .
x1 is the ending x location.
y1 is the ending y location.
Returns:
TRUE if the unit is in reach of (x1, y1).

#define cell_material_defined  )     (area.materials[m] != NULL)
 

Is this material defined in cells?

Check to see if a specific material is defined in cells.

Parameters:
m is the material type.
Returns:
  • TRUE if the area.materials[m] is not NULL;
  • FALSE otherwise.

 
#define cloud_bottoms_defined  )     (area.cloudbottoms != NULL)
 

Are cloud bottoms defined?

Check to see if cloud bottoms are used in game.

Returns:
  • TRUE if area.cloud bottoms is not NULL;
  • FALSE otherwise.

 
#define cloud_heights_defined  )     (area.cloudheights != NULL)
 

Are cloud tops defined?

Check to see if cloud tops are used in game.

Returns:
  • TRUE if area.cloud tops is not NULL;
  • FALSE otherwise.

 
#define clouds_defined  )     (area.clouds != NULL)
 

Are clouds defined?

Check to see if clouds are used in game.

Returns:
  • TRUE if area.clouds is not NULL;
  • FALSE otherwise.

#define connection_at x,
y,
dir,
 )     (aux_terrain_defined(c) ? (aux_terrain_at(x, y, c) & (1 << (dir))) : FALSE)
 

Is connection in dirction at.

See if there is a connection in the specified direction at cell(x,y) for the specified connection type.

See also:
aux_terrain_at.
Parameters:
x is the x location.
y is the y location.
dir is the direction to check.
c is the connection Terrain type.
Returns:
  • TRUE if the cell(x,y) has a connection in a particular direction;
  • FALSE otherwise.

#define control_side_at x,
 )     aref(area.controlside, x, y)
 

Controled by at.

Retrieve the side that controls cell(x,y).

Parameters:
x is the x location.
y is the y location.
Returns:
  • Side id if controlled by a side.
  • NOCONTROL if not controlled by a side.

 
#define control_sides_defined  )     (area.controlside != NULL)
 

Is Area control defined?

Check to see if the control layer is defined.

Returns:
  • TRUE if araa.controlside is not NULL;
  • FALSE otherwise.

#define controlled x,
 )     (control_side_at(x,y) != NOCONTROL)
 

Is Controlled?

Check to see if the cell(x,y) is controlled by a side.

See also:
control_side_at.
Parameters:
x is the x location.
y is the y location.
Returns:
  • TRUE if Side number is not NOCONTROL; _ FALSE otherwise.

#define elev_at x,
 )     aref(area.elevations, x, y)
 

Elevation at.

Get the elevation at cell(x,y). Elevations are stored in area.elevations.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
elevation at cell(x,y).

 
#define elevations_defined  )     (area.elevations != NULL)
 

Are elevations defined?

Check to see if the elevation layer has been defined.

Returns:
  • TRUE if area.elevations has been allocated;
  • FALSE if pointer is NULL.

 
#define features_defined  )     (area.features != NULL)
 

Are features defined?

Check to see if features are defined in this game.

Returns:
  • TRUE if area.features is not NULL;
  • FALSE otherwise.

#define for_all_cells x,
 ) 
 

Value:

for (x = 0; x < area.width; ++x)  \
    for (y = 0; y < area.height; ++y)  \
      if (x_in_area(x, y))
Iterate over all cells.

Iteration over all valid cell positions in a area. These should be used carefully, since they don't (can't) have any grouping braces embedded.

See also:
x_in_area.
Parameters:
x is the x co-ordinate.
y is the y co-ordiante.

#define for_all_cells_within_range x,
y,
n,
x1,
y1   ) 
 

Value:

for((x1) = (x) - (n); (x1) <= (x) + (n); (x1)++) \
        for((y1) = max((y) - (n), (y) - (n) + (x) - (x1)); \
               (y1) <= min((y) + (n), (y) + (n) + (x) - (x1)); (y1)++)
Iterate over range.

For header to repeat for all cells within range of starting cell.

Parameters:
x is the starting x location.
y is the starting y location.
n is the range.
x1 is the iteration x location of a cell in range.
y1 is the iteration y location of a cell in range.

#define for_all_cells_within_reach u,
x1,
y1   )     for_all_cells_within_range((u)->x, (u)->y, (u)->reach, (x1), (y1))
 

Iterate over all cells in range.

Repeat for all cells withing reach of a unit.

See also:
for_all_cells_within_range.
Parameters:
u is a pointer to .
x1 is the iteration x location of a cell in range.
y1 is the iteration y location of a cell in range.

#define for_all_features feat   )     for ((feat) = featurelist; (feat) != NULL; (feat) = (feat)->next)
 

Iterate through features.

Walk thrhoug all defined features.

Parameters:
feat is the feature iteration variable.

#define for_all_interior_cells x,
 ) 
 

Value:

for (x = 0; x < area.width; ++x)  \
    for (y = 1; y < area.height - 1; ++y)  \
      if (x_inside_area(x, y))
Iterate over all interior cells.

This doesn't generate positions along area edges. Typically more useful within game than for_all_cells(). Iteration over all valid interior cell positions in a area. These should be used carefully, since they don't (can't) have any grouping braces embedded.

See also:
x_inside_area.
Parameters:
x is the x co-ordinate.
y is the y co-ordiante.

#define for_all_stack x,
y,
var   )     for ((var) = unit_at((x), (y)); (var) != NULL; (var) = (var)->nexthere)
 

Iterate Unit stack.

Iterate through all in this cell (but not their occs).

Parameters:
x is the x location.
y is the y location.
var is the pointer.

#define for_all_stack_with_occs x,
y,
var   ) 
 

Value:

for ((var) = unit_at((x), (y)); \
          (var) != NULL; \
         (var) = ((var)->occupant != NULL ? \
                        (var)->occupant : \
                      ((var)->nexthere != NULL ? \
                        (var)->nexthere : \
                      ((var)->transport != NULL && \
                        (var)->transport->nexthere != NULL ? \
                        (var)->transport->nexthere : \
                      ((var)->transport != NULL && \
                        (var)->transport->transport != NULL && \
                        (var)->transport->transport->nexthere != NULL ? \
                        (var)->transport->transport->nexthere : \
                      ((var)->transport != NULL && \
                        (var)->transport->transport != NULL && \
                        (var)->transport->transport->transport != NULL && \
                        (var)->transport->transport->transport->nexthere != NULL ? \
                        (var)->transport->transport->transport->nexthere : NULL))))))
Iterate Unit stack and occupants.

Iterate through all units in this cell including occs within occs within occs. This nifty little macro will climb the occupant : nexthere tree and follow all branches four levels down to find all the occs within occs within occs within units in the stack.

Parameters:
x is the x location.
y is the y location.
var is the pointer.

#define in_area x,
 )     (between(0, (y), area.height-1) && x_in_area(x, y))
 

Is in area?

Test whether x,y is a valid position anywhere in the current area.

Note:
in_area and inside_area are very heavily used; any optimization will likely speed up Xconq overall.
See also:
between, x_in_area.
Parameters:
x is the x co-ordinate.
y is the y co-ordiante.
Returns:
  • TRUE if cell(x,y) is in area;
  • FALSE otherwise.

#define inside_area x,
 )     (between(1, (y), area.height-2) && x_inside_area(x, y))
 

Is valid unit position?

Test whether x,y is a valid position anywhere in the current area.

Note:
in_area and inside_area are very heavily used; any optimization will likely speed up Xconq overall.
Bug:
Does x testing work right for even/odd heights?
See also:
between, x_inside_area.
Parameters:
x is the x co-ordinate.
y is the y co-ordiante.
Returns:
  • TRUE if cell(x,y) is inside area;
  • FALSE otherwise.

#define interior  )     (max(1, min((y), (area.height-2))))
 

Constrain y to inerior of world.

Constrain y co-ordinate to be within world.

See also:
max, min.
Parameters:
y is raw y co-ordiante.
Returns:
y co-ordinate in interior of world.

#define lighting x,
y,
snx,
sny   ) 
 

Value:

((world_distance(x, y, snx, sny) < world.daylight_width) ? 2 : \
   ((world_distance(x, y, snx, sny) < world.twilight_width) ? 1 : 0))
Lighting at cell.

Returns the lighting state of a given position.

Todo:
(should opencode distance call here)
Parameters:
x is the cell's x co-ordinate.
y is the cell's y co-ordinate.
snx is the sun's x co-ordinate.
sny is the sun's y co-ordiante.
Returns:
  • two if in sunlight;
  • one if in twilight; or
  • zero if in darkness.

#define limity  )     (max(0, min((y), (area.height-1))))
 

Constrain y co-ordinate.

Constrain y to northern and southern edges.

See also:
max, min.
Parameters:
y is raw y co-ordiante.
Returns:
y co-ordinate withing world boundary.

#define malloc_area_layer TYPE   )     ((TYPE *) xmalloc(area.width * area.height * sizeof(TYPE)))
 

Allocate layer.

Use this macro to get a area-spanning layer of the given type. This allocates enough memory to hold a value of TYPE for every cell in the world.

Parameters:
TYPE is the type of the layer to allocate.
Returns:
pointer to allocated area.

#define material_at x,
y,
 )     aref(area.materials[m], x, y)
 

Material at cell.

Get the amount of a specific material in cexll(x,y).

See also:
aref.
Parameters:
x is the x location.
y is the y location.
m is the Material type.
Returns:
the amount of the material at cell(x,y).

#define MINHEIGHT   3
 

Minimum Area height.

This is the smallest allowable height for a map.

See also:
MINWIDTH.

#define MINWIDTH   3
 

Minimum Area width.

This is the smallest allowable width for a map.

Note:
Theoretically, there is no maximum size to Xconq areas, but the minimum size is set by mystical properties, and is not negotiable.

#define night_at x,
 )     (daynight && lighting((x), (y), (int) sunx, (int) suny) == 0)
 

Night at cell?

Is it night at cell(x,y)

See also:
lighting, sunx, suny.
Parameters:
x is the cell's x co-ordinate.
y is the cell's y co-ordinate.
Returns:
  • TRUE if lighting is 0 at cell;
  • FALSE otherwise.

#define NOBODY   (60)
 

Nobody.

A cell might be entirely uninhabited, so need an extra value to indicate. This value is chosen to be well above any possible MAXSIDES, and encodes in layers as 'X', which is convenient.

Note:
It might be better to define this in terms of MAXSIDES, to make sure there is no conflict.

#define NOCONTROL   (60)
 

A cell might be entirely uncontrolled, so need an extra value to indicate. This value is chosen to be well above any possible MAXSIDES, and encodes in layers as 'X', which is convenient.

Note:
It might be better to define this in terms of MAXSIDES, to make sure there is no conflict.

#define NOUSER   (0)
 

No user id.

This needs to not be the id of any unit.

#define people_side_at x,
 )     aref(area.peopleside, x, y)
 

Side of people at.

Get the Side number of the people at cell(x,y).

Parameters:
x is the x location.
y is the y location.
Returns:
Side number of people at cell(x,y).

 
#define people_sides_defined  )     (area.peopleside != NULL)
 

Population defined?

Check to see if people are assigned to sides.

Returns:
  • TRUE if area.peopleside is not NULL;
  • FALSE otherwise.

#define populated x,
 )     (people_side_at(x,y) != NOBODY)
 

Is populated?

Check to see if the cell(x,y) is populated.

Parameters:
x is the x location.
y is the y location.
Returns:
  • TRUE if Side number is not NOBODY; _ FALSE otherwise.

#define radius_covers_n_cells dist   )     (1 + (((dist) + 1) * (dist) * 3))
 

Number of cells covered by a radius.

Calculate number of cells that could be covered by a radius sweeping from an origin. Obviously, one should not provide a radius length < 0.

Parameters:
dist is the length of the radius.
Returns:
Number of cells covered by the radius.

#define raw_cloud_at x,
 )     aref(area.clouds, x, y)
 

Clouds at cell.

Get clouds at cell(x,y).

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
the clouds at cell(x,y).

#define raw_cloud_bottom_at x,
 )     aref(area.cloudbottoms, x, y)
 

Cloud bottom at cell.

Get cloud bottom at cell(x,y).

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
the cloud bottom at cell(x,y).

#define raw_cloud_height_at x,
 )     aref(area.cloudheights, x, y)
 

Cloud top at cell.

Get cloud top at cell(x,y).

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
the cloud top at cell(x,y).

#define raw_feature_at x,
 )     aref(area.features, x, y)
 

Raw feature at. Get the id fo the feature at cell(x,y). The "raw feature" is its "short" identifier.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
the short feature id.

#define raw_wind_at x,
 )     aref(area.winds, x, y)
 

Raw wind at cell.

Get raw wind value at cell(x,y). The raw wind value is a combination of direction and force. The direction is in the bottom 3 bits of the cell value.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
the raw wind at cell(x,y).

#define set_aux_terrain_at x,
y,
at,
 )     aset(area.auxterrain[at], x, y, v)
 

Set auxillary Terrain at.

Set the auxillary terrain at a cell.

See also:
aset.
Parameters:
x is the x location.
y is the y location.
at is the auxillary Terrain type.
v is the new value of the auxillary terrain.
Returns:
the new value of the auxillary Terrain type at cell(x,y).

#define set_control_side_at x,
y,
 )     aset(area.controlside, x, y, s)
 

Set controled by at.

Set the side that controls cell(x,y).

Parameters:
x is the x location.
y is the y location.
s is the new Side id that controls the cell.
Returns:
  • Side id if controlled by a side.
  • NOCONTROL if not controlled by a side.

#define set_elev_at x,
y,
 )     aset(area.elevations, x, y, v)
 

Set elevation at.

Set the elevation at cell(x,y). Elevations are stored in area.elevations.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
v is the new value for the elevation.
Returns:
new elevation at cell(x,y).

#define set_material_at x,
y,
m,
 )     aset(area.materials[m], x, y, v)
 

Set Material at cell.

Set the amount of a specific material in cexll(x,y).

See also:
aref.
Parameters:
x is the x location.
y is the y location.
m is the Material type.
v is the new value of the amount of Material at cell(x.y)
Returns:
the amount of the material at cell(x,y).

#define set_people_side_at x,
y,
 )     aset(area.peopleside, x, y, s)
 

Set Side of people at.

Set the Side number of the people at cell(x,y).

Parameters:
x is the x location.
y is the y location.
s is the new Side number.
Returns:
new Side number of people at cell(x,y).

#define set_raw_cloud_at x,
y,
 )     aset(area.clouds, x, y, v)
 

Set clouds at cell.

set clouds at cell(x,y).

See also:
aset.
Parameters:
x is the x location.
y is the y location.
v is the new value of clouds.
Returns:
the clouds at cell(x,y).

#define set_raw_cloud_bottom_at x,
y,
 )     aset(area.cloudbottoms, x, y, v)
 

Set cloud bottoms at cell.

set cloud bottom at cell(x,y).

See also:
aset.
Parameters:
x is the x location.
y is the y location.
v is the new value of the cloud bottom.
Returns:
the cloud bottom at cell(x,y).

#define set_raw_cloud_height_at x,
y,
 )     aset(area.cloudheights, x, y, v)
 

Set cloud top at cell.

set cloud top at cell(x,y).

See also:
aset.
Parameters:
x is the x location.
y is the y location.
v is the new value of the cloud top.
Returns:
the cloud top at cell(x,y).

#define set_raw_feature_at x,
y,
 )     aset(area.features, x, y, f)
 

Set raw feature at. Set the id fo the feature at cell(x,y). The "raw feature" is its "short" identifier.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
f is the feature id.
Returns:
the short feature id.

#define set_raw_wind_at x,
y,
 )     aset(area.winds, x, y, v)
 

Set raw wind at cell.

Set raw wind value at cell(x,y). The raw wind value is a combination of direction and force. The direction is in the bottom 3 bits of the cell value.

See also:
aset.
Parameters:
x is the x location.
y is the y location.
v is the new raw wind value.
Returns:
the raw wind at cell(x,y).

#define set_temperature_at x,
y,
 )     aset(area.temperature, x, y, v)
 

Set temperature at cell.

Set temperature at cell(x,y).

See also:
aset.
Parameters:
x is the x location.
y is the y location.
v is the new temperature.
Returns:
the temperature at cell(x,y).

#define set_terrain_at x,
y,
 )     aset(area.terrain, x, y, t)
 

Set Terrain at.

Set the Terrain type at cell(x,y);

See also:
aset.
Parameters:
x is the x location.
y is the y location.
t is the Terran type to which to set the cell.
Returns:
the Terrain type at the cell.

#define set_tmp1_at x,
y,
 )     aset(area.tmp1, x, y, v)
 

Set scratch layer 1.

Set the value of scratch layer 1 at cell(x,y).

Parameters:
x is the x location.
y is the y location.
v is the new value.
Returns:
the value of scratch layer 1 at cell(x,y).

#define set_tmp2_at x,
y,
 )     aset(area.tmp2, x, y, v)
 

Set scratch layer 2.

Set the value of scratch layer 2 at cell(x,y).

Parameters:
x is the x location.
y is the y location.
v is the new value.
Returns:
the value of scratch layer 2 at cell(x,y).

#define set_tmp3_at x,
y,
 )     aset(area.tmp3, x, y, v)
 

Set scratch layer 3.

Set the value of scratch layer 3 at cell(x,y).

Parameters:
x is the x location.
y is the y location.
v is the new value.
Returns:
the value of scratch layer 3 at cell(x,y).

#define set_unit_at x,
y,
 )     aset(area.units, x, y, u)
 

Set unit at cell.

Set the pointer to the at cell(x,y).

Note:
This macro DOES NOT link the Unit to any previous Units at the location, so it has to be done manually.
Parameters:
x is the x location.
y is the y location.
u is the pointer.

#define set_user_at x,
y,
 )     aset(area.user, x, y, u)
 

#define set_wind_at x,
y,
d,
 )     (set_raw_wind_at(x, y, ((f) << 3) | (d)))
 

Set wind at cell.

Set wind value at cell(x,y).

See also:
set_raw_wind_at.
Parameters:
x is the x location.
y is the y location.
d is the new wind direction value.
f is the new wind force value.
Returns:
the raw wind at cell(x,y).

#define temperature_at x,
 )     aref(area.temperature, x, y)
 

Temperature at cell.

Get temperature at cell(x,y).

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
the temperature at cell(x,y).

 
#define temperatures_defined  )     (area.temperature != NULL)
 

Is temperature defined?

Check to see if temperature is defined.

Returns:
  • TRUE if area.temperature is not NULL;
  • FALSE otherwise.

#define terrain_at x,
 )     aref(area.terrain, x, y)
 

Terrain at.

The Terrain at each cell is just the number of the Terrain type.

See also:
aset.
Parameters:
x is the x location.
y is the y location.
Returns:
the Terrain type at the cell.

 
#define terrain_defined  )     (area.terrain != NULL)
 

Is Terrain defined.

Test if the terrain has been allocated yet.

Returns:

#define tmp1_at x,
 )     aref(area.tmp1, x, y)
 

Get scratch layer 1.

Get the value of scratch layer 1 at cell(x,y).

Parameters:
x is the x location.
y is the y location.
Returns:
the value of scratch layer 1 at cell(x,y).

#define tmp2_at x,
 )     aref(area.tmp2, x, y)
 

Get scratch layer 2.

Get the value of scratch layer 2 at cell(x,y).

Parameters:
x is the x location.
y is the y location.
Returns:
the value of scratch layer 2 at cell(x,y).

#define tmp3_at x,
 )     aref(area.tmp3, x, y)
 

Get scratch layer 3.

Get the value of scratch layer 3 at cell(x,y).

Parameters:
x is the x location.
y is the y location.
Returns:
the value of scratch layer 3 at cell(x,y).

#define unit_at x,
 )     aref(area.units, x, y)
 

Unit at cell.

The is a raw pointer - this macro is used a *lot*. This could be space-optimized by using a 16-bit unit id. It uses the area.units global layer. Multiple units can be stacked by building a list using the ->nexthere pointer.

See also:
aref.
Parameters:
x is the x location.
y is the y location.
Returns:
pointer to at (x,y).

#define user_at x,
 )     aref(area.user, x, y)
 

User at?

Get the User id at cell.

Parameters:
x is the x co-ordinate of the cell.
y is the y co-ordinate of the cell.
Returns:
the user id at cell(x,y).

 
#define user_defined  )     (area.user != NULL)
 

Is user area defined?

Returns:
  • TRUEE if the area.user is not NULL;
  • FALSE otherwize.

#define wind_dir  )     ((w) & 0x07)
 

Wind direction.

Extract the wind direction from the raw wind value.

Parameters:
w is the raw wind value.
Returns:
the wind direction.

#define wind_dir_at x,
 )     (wind_dir(raw_wind_at(x, y)))
 

Wind direction at.

Get the wind direction at cell(x,y).

See also:
wind_dir, raw_wind_at.
Parameters:
x is the x location.
y is the y location.
Returns:
the wind direction at cell(x,y).

#define wind_force  )     ((w) >> 3)
 

Wind froce.

Extract the wind force from the raw wind value.

Parameters:
w is the raw wind value.
Returns:
the wind force.

#define wind_force_at x,
 )     (wind_force(raw_wind_at(x, y)))
 

Wind force at.

Get the wind force at cell(x,y).

See also:
wind_force, raw_wind_at.
Parameters:
x is the x location.
y is the y location.
Returns:
the wind force at cell(x,y).

 
#define winds_defined  )     (area.winds != NULL)
 

Are winds defined?

Check to see if winds are used in game.

Returns:
  • TRUE if area.winds is not NULL;
  • FALSE otherwise.

#define wrapx  )     (area.xwrap ? (((x) + (area.width << 8)) % area.width) : (x))
 

Wrap x.

This little macro implements wraparound in the x direction.

Note:
The stupid add of shifted width is for the benefit of brain-damaged mod operators that don't handle negative numbers properly.
Parameters:
x is the unwrapped x value.
Returns:
the value within the world bounds.

#define x_in_area x,
 ) 
 

Value:

(area.xwrap ? TRUE : (between(0, (x), area.width-1) &&  \
                        between(area.halfheight,  \
                                (x)+(y),  \
                                area.width+area.halfheight-1)))
Is x in area?

Test whether x is a inside the current area.

Note:
in_area and inside_area are very heavily used; any optimization will likely speed up Xconq overall.
See also:
between.
Parameters:
x is the x co-ordinate.
y is the y co-ordiante.
Returns:
  • TRUE if cell(x,y) is in area;
  • FALSE otherwise.

#define x_inside_area x,
 ) 
 

Value:

(area.xwrap ? TRUE : (between(1, (x), area.width-2) &&  \
                        between(area.halfheight+1,  \
                                (x)+(y),  \
                                area.width+area.halfheight-2)))
Is x a valid unit postion?

Test whether x is a inside the current area.

Note:
in_area and inside_area are very heavily used; any optimization will likely speed up Xconq overall.
Bug:
Does x testing work right for even/odd heights?
See also:
between.
Parameters:
x is the x co-ordinate.
y is the y co-ordiante.
Returns:
  • TRUE if cell(x,y) is in area;
  • FALSE otherwise.

#define xy_in_dir x,
y,
dir,
nx,
ny   )     (nx) = wrapx((x) + dirx[dir]); (ny) = (y) + diry[dir];
 

Coordinate in direction.

Calculate the co-ordinates of moving a distance of one in a direction, contraining the x co-ordiante to be wrapped.

Note:
The y co-odinate is not limited or constrained.
See also:
wrapx..
Parameters:
x is the current x co-ordinate.
y is the current y co-ordinate.
d is the direction to move.
nx is the new x co-ordinate.
ny is the new y co-ordiante.
Returns:
the new y co-ordiante.

#define zero_area_layer ADDR,
TYPE   )     (memset(ADDR, 0, area.width * area.height * sizeof(TYPE)))
 

Zero area.

This sets an allocated layer to zero using memset by calculating the number of cells in the area times the size of TYPE. It uses the size of the global area to determine the area size.

Parameters:
ADDR is the address of the area to zero.
TYPE is the type of the layer to allocate.
Returns:
the return value of memset.


Typedef Documentation

typedef struct a_area Area
 

Area.

An "area" is always basically a rectangular array of positions. The hex effect can be achieved by interpreting neighborliness and direction differently, but that's all that's needed. All of the "layers" are dynamically allocated as needed, to save (considerable!) space.

See the discussion of layers for a more complet discussion of the various types of layers.

typedef struct a_feature Feature
 

Feature.

Named geographical features.

typedef struct a_path Path
 

Path.

Array of waypoints defining path.

typedef struct a_region TRegion
 

Region.

typedef struct a_region_link TRegionLink
 

Terrain Region Link.

typedef struct a_waypoint Waypoint
 

Waypoint.

Co-ordinate of point in path. ???

typedef struct a_world World
 

World.

This structure contains variables which affect the entire world map.


Function Documentation

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  ) 
 

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

Feature* feature_at int  x,
int  y
 

void final_init_world void   ) 
 

Feature* find_feature int  fid  ) 
 

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
 

int hextant int  dx,
int  dy
 

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 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 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
 

int set_world_circumference int  circum,
int  warn
 

void terrain_subtype_warning char *  context,
int  t
 

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
 

Any clouds? ???

int any_elev_variation
 

Any elevation variation? ???

int any_materials_in_terrain
 

Any Materials in terrain? ???

int any_temp_variation
 

Any temperture variation? ???

int any_temp_variation_in_layer
 

Any temperature variation in layer? ???

int any_wind_variation
 

Any wind variation? ???

int any_wind_variation_in_layer
 

Any wind variation in layer? ???

Area area
 

Area global.

int maxelev
 

Maximum elevation.

int maxtemp
 

Maximum termperature.

int maxwindforce
 

Maximum windforce.

int midturnrestore
 

Mid turn restore flag. ???

int minelev
 

Minimum elevation.

int mintemp
 

Minimum termperature.

int minwindforce
 

Minimum wind forces.

int numfeatures
 

Number of features.

World world
 

World global.


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