Crossfire Server, Trunk
room_gen_onion.cpp File Reference
#include <stdlib.h>
#include <global.h>
#include <random_map.h>
+ Include dependency graph for room_gen_onion.cpp:

Go to the source code of this file.

Macros

#define MIN(x, y)   (((x) < (y)) ? (x) : (y))
 

Functions

void bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 
void bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 
void centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 
void draw_onion (char **maze, float *xlocations, float *ylocations, int layers)
 
void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options)
 
char ** map_gen_onion (int xsize, int ysize, int option, int layers)
 

Detailed Description

The onion room generator: Onion rooms are like this:

char **map_gen_onion(int xsize, int ysize, int option, int layers);

like this: regular random centered, linear onion bottom/right centered, nonlinear

autotoc_md3

autotoc_md4

autotoc_md5

autotoc_md6

autotoc_md7

autotoc_md8

autotoc_md9

autotoc_md10

autotoc_md11

autotoc_md12

autotoc_md13

autotoc_md14

autotoc_md15

Definition in file room_gen_onion.cpp.

Macro Definition Documentation

◆ MIN

#define MIN (   x,
 
)    (((x) < (y)) ? (x) : (y))

Definition at line 48 of file room_gen_onion.cpp.

Function Documentation

◆ bottom_centered_onion()

void bottom_centered_onion ( char **  maze,
int  xsize,
int  ysize,
int  option,
int  layers 
)

Create a bottom-centered layout.

Parameters
mazelayout.
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers to create.

Definition at line 219 of file room_gen_onion.cpp.

References draw_onion(), make_doors(), MIN, OPT_IRR_SPACE, CFweardisguise::option, and RANDOM.

Referenced by map_gen_onion().

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

◆ bottom_right_centered_onion()

void bottom_right_centered_onion ( char **  maze,
int  xsize,
int  ysize,
int  option,
int  layers 
)

Create a bottom-right-centered layout.

Parameters
mazelayout.
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers to create.

Definition at line 471 of file room_gen_onion.cpp.

References draw_onion(), make_doors(), MIN, OPT_IRR_SPACE, CFweardisguise::option, and RANDOM.

Referenced by map_gen_onion().

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

◆ centered_onion()

void centered_onion ( char **  maze,
int  xsize,
int  ysize,
int  option,
int  layers 
)

Creates a centered onion layout.

Parameters
mazelayout.
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers to create.

Definition at line 141 of file room_gen_onion.cpp.

References draw_onion(), make_doors(), MIN, OPT_IRR_SPACE, CFweardisguise::option, and RANDOM.

Referenced by map_gen_onion().

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

◆ draw_onion()

void draw_onion ( char **  maze,
float *  xlocations,
float *  ylocations,
int  layers 
)

Draws the lines in the maze defining the onion layers.

Parameters
mazemap to draw to.
xlocations
ylocationsarray of locations.
layersnumber of layers.
Todo:
explain what locations arrays should be, and the meaning of layers.

Definition at line 306 of file room_gen_onion.cpp.

References make_face_from_files::int, and banquet::l.

Referenced by bottom_centered_onion(), bottom_right_centered_onion(), and centered_onion().

+ Here is the caller graph for this function:

◆ make_doors()

void make_doors ( char **  maze,
float *  xlocations,
float *  ylocations,
int  layers,
int  options 
)

Add doors to the layout.

Parameters
mazemap to draw to.
xlocations
ylocationsarray of locations. Will be free()d.
layersnumber of layers.
optionscombination of OPT_xxx values.
Todo:
explain what locations arrays should be, and the meaning of layers.

Definition at line 345 of file room_gen_onion.cpp.

References cleanup(), make_face_from_files::int, banquet::l, OPT_BOTTOM_C, OPT_BOTTOM_R, OPT_LINEAR, OPT_NO_DOORS, options, and RANDOM.

Referenced by bottom_centered_onion(), bottom_right_centered_onion(), and centered_onion().

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

◆ map_gen_onion()

char** map_gen_onion ( int  xsize,
int  ysize,
int  option,
int  layers 
)

Generates an onion layout.

Parameters
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers the onion should have.
Returns
layout.

Definition at line 70 of file room_gen_onion.cpp.

References bottom_centered_onion(), bottom_right_centered_onion(), centered_onion(), OPT_BOTTOM_C, OPT_BOTTOM_R, OPT_CENTERED, OPT_IRR_SPACE, OPT_LINEAR, OPT_WALL_OFF, OPT_WALLS_ONLY, CFweardisguise::option, and RANDOM.

Referenced by layoutgen(), and make_square_spiral_layout().

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