|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Functions | |
| void | dump_layout (char **layout, RMParms *RP) |
| mapstruct * | generate_random_map (char *OutFileName, RMParms *RP) |
| char ** | layoutgen (RMParms *RP) |
| char ** | symmetrize_layout (char **maze, int sym, RMParms *RP) |
| char ** | rotate_layout (char **maze, int rotation, RMParms *RP) |
| void | roomify_layout (char **maze, RMParms *RP) |
| int | can_make_wall (char **maze, int dx, int dy, int dir, RMParms *RP) |
| int | make_wall (char **maze, int x, int y, int dir) |
| void | doorify_layout (char **maze, RMParms *RP) |
| void | write_map_parameters_to_string (char *buf, RMParms *RP) |
Random map generation main routines.
Definition in file random_map.c.
| int can_make_wall | ( | char ** | maze, |
| int | dx, | ||
| int | dy, | ||
| int | dir, | ||
| RMParms * | RP | ||
| ) |
Checks the layout to see if we can stick a horizontal (dir = 0) wall (or vertical, dir == 1) here which ends up on other walls sensibly.
| maze | Layout. |
| dx | X coordinate to check |
| dy | Y coordinate to check |
| dir | Direction:
|
| RP | Random map parameters. |
Definition at line 647 of file random_map.c.
| void doorify_layout | ( | char ** | maze, |
| RMParms * | RP | ||
| ) |
Puts doors at appropriate locations in a layout.
| maze | Layout. |
| RP | Random map parameters. |
Definition at line 829 of file random_map.c.
| void dump_layout | ( | char ** | layout, |
| RMParms * | RP | ||
| ) |
Dumps specified layout using printf().
| layout | The layout to dump. |
| RP | Layout parameters. |
Definition at line 37 of file random_map.c.
Main random map routine. Generates a random map based on specified parameters.
| OutFileName | The path the map should have. |
| RP | Parameters for generation. |
Definition at line 68 of file random_map.c.
| char** layoutgen | ( | RMParms * | RP | ) |
This function builds the actual layout. Selects the layout based on parameters and gives it whatever arguments it needs.
| RP | Random map parameters. |
Definition at line 162 of file random_map.c.
| int make_wall | ( | char ** | maze, |
| int | x, | ||
| int | y, | ||
| int | dir | ||
| ) |
Cuts the layout horizontally or vertically by a wall with a door.
| maze | Layout. |
| x | X position where to put the door. |
| y | Y position where to put the door. |
| dir | Wall direction:
|
Definition at line 784 of file random_map.c.
| void roomify_layout | ( | char ** | maze, |
| RMParms * | RP | ||
| ) |
Take a layout and make some rooms in it. Works best on onions.
| maze | Layout to alter. |
| RP | Random map parameters. |
Definition at line 588 of file random_map.c.
| char** rotate_layout | ( | char ** | maze, |
| int | rotation, | ||
| RMParms * | RP | ||
| ) |
Takes a map and rotates it. This completes the onion layouts, making them possibly centered on any wall.
It'll modify Xsize and Ysize if they're swapped.
| maze | Layout to rotate, will be freed by this function. |
| rotation | How to rotate:
|
| RP | Random map parameters. |
Definition at line 490 of file random_map.c.
| char** symmetrize_layout | ( | char ** | maze, |
| int | sym, | ||
| RMParms * | RP | ||
| ) |
Takes a map and makes it symmetric: adjusts Xsize and Ysize to produce a symmetric map.
| maze | Layout to symmetrize. Will be freed by this function. |
| sym | how to make symmetric, a Random map symmetry value. |
| RP | Random map parameters. |
Definition at line 386 of file random_map.c.
| void write_map_parameters_to_string | ( | char * | buf, |
| RMParms * | RP | ||
| ) |
Creates a suitable message for exit from RP.
| buf | Buffer that will contain RP's values. |
| RP | Parameters to convert to message. |
Definition at line 890 of file random_map.c.
1.7.4