Crossfire Server, Trunk
random_map.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RMParms
 

Macros

#define BC_RANDOM(x)   ((int) ((RANDOM()%(x)+RANDOM()%(x)+RANDOM()%(x))/3.))
 
#define MAZE_LAYOUT   2
 
#define MIN_RANDOM_MAP_SIZE   10
 
#define NO_SYM   1
 
#define NROFLAYOUTS   6
 
#define ONION_LAYOUT   1
 
#define OPT_BOTTOM_C   4
 
#define OPT_BOTTOM_R   8
 
#define OPT_CENTERED   1
 
#define OPT_IRR_SPACE   16
 
#define OPT_LINEAR   2
 
#define OPT_NO_DOORS   256
 
#define OPT_RANDOM   0
 
#define OPT_WALL_OFF   32
 
#define OPT_WALLS_ONLY   64
 
#define RANDOM_SYM   0
 
#define RM_SIZE   512
 
#define ROGUELIKE_LAYOUT   4
 
#define SNAKE_LAYOUT   5
 
#define SPIRAL_LAYOUT   3
 
#define SQUARE_SPIRAL_LAYOUT   6
 
#define X_SYM   2
 
#define XY_SYM   4
 
#define Y_SYM   3
 

Functions

int load_parameters (FILE *fp, int bufstate, RMParms *RP)
 
int set_random_map_variable (RMParms *rp, const char *buf)
 

Detailed Description

Random map related variables.

Definition in file random_map.h.

Macro Definition Documentation

◆ BC_RANDOM

#define BC_RANDOM (   x)    ((int) ((RANDOM()%(x)+RANDOM()%(x)+RANDOM()%(x))/3.))

Macro to get a strongly centered random distribution, from 0 to x, centered at x/2

Definition at line 158 of file random_map.h.

◆ MAZE_LAYOUT

#define MAZE_LAYOUT   2

Definition at line 113 of file random_map.h.

◆ MIN_RANDOM_MAP_SIZE

#define MIN_RANDOM_MAP_SIZE   10

Minimal size a random should have to actually be generated.

Definition at line 153 of file random_map.h.

◆ NO_SYM

#define NO_SYM   1

No symmetry.

Definition at line 146 of file random_map.h.

◆ NROFLAYOUTS

#define NROFLAYOUTS   6

Definition at line 118 of file random_map.h.

◆ ONION_LAYOUT

#define ONION_LAYOUT   1

Definition at line 112 of file random_map.h.

◆ OPT_BOTTOM_C

#define OPT_BOTTOM_C   4

Bottom-centered.

Definition at line 131 of file random_map.h.

◆ OPT_BOTTOM_R

#define OPT_BOTTOM_R   8

Bottom-right centered.

Definition at line 132 of file random_map.h.

◆ OPT_CENTERED

#define OPT_CENTERED   1

Centered.

Definition at line 129 of file random_map.h.

◆ OPT_IRR_SPACE

#define OPT_IRR_SPACE   16

Irregularly/randomly spaced layers (default: regular).

Definition at line 133 of file random_map.h.

◆ OPT_LINEAR

#define OPT_LINEAR   2

Linear doors (default is nonlinear).

Definition at line 130 of file random_map.h.

◆ OPT_NO_DOORS

#define OPT_NO_DOORS   256

Place walls insead of doors. Produces broken map.

Definition at line 136 of file random_map.h.

◆ OPT_RANDOM

#define OPT_RANDOM   0

Random option.

Definition at line 128 of file random_map.h.

◆ OPT_WALL_OFF

#define OPT_WALL_OFF   32

No outer wall.

Definition at line 134 of file random_map.h.

◆ OPT_WALLS_ONLY

#define OPT_WALLS_ONLY   64

Only walls.

Definition at line 135 of file random_map.h.

◆ RANDOM_SYM

#define RANDOM_SYM   0

Random symmetry.

Definition at line 145 of file random_map.h.

◆ RM_SIZE

#define RM_SIZE   512

Definition at line 9 of file random_map.h.

◆ ROGUELIKE_LAYOUT

#define ROGUELIKE_LAYOUT   4

Definition at line 115 of file random_map.h.

◆ SNAKE_LAYOUT

#define SNAKE_LAYOUT   5

Definition at line 116 of file random_map.h.

◆ SPIRAL_LAYOUT

#define SPIRAL_LAYOUT   3

Definition at line 114 of file random_map.h.

◆ SQUARE_SPIRAL_LAYOUT

#define SQUARE_SPIRAL_LAYOUT   6

Definition at line 117 of file random_map.h.

◆ X_SYM

#define X_SYM   2

Vertical symmetry.

Definition at line 147 of file random_map.h.

◆ XY_SYM

#define XY_SYM   4

Reflection.

Definition at line 149 of file random_map.h.

◆ Y_SYM

#define Y_SYM   3

Horizontal symmetry.

Definition at line 148 of file random_map.h.

Function Documentation

◆ load_parameters()

int load_parameters ( FILE *  fp,
int  bufstate,
RMParms RP 
)

Definition at line 2476 of file reader.cpp.

References LL_EOF, LL_NORMAL, LO_LINEMODE, LO_NEWFILE, LO_NOREAD, MAX_BUF, rmap_lex_read(), YY_BUF_SIZE, yy_create_buffer, YY_CURRENT_BUFFER, yy_delete_buffer, yy_scan_string, and yy_switch_to_buffer.

Referenced by generate_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_random_map_variable()

int set_random_map_variable ( RMParms rp,
const char *  buf 
)

Definition at line 2510 of file reader.cpp.

References buf, rmap_lex_read(), yy_delete_buffer, and yy_scan_string.

Referenced by cfapi_set_random_map_variable(), enter_random_map(), enter_random_template_map(), and RandomMap::RandomMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: