Crossfire Server, Branch 1.12  R12190
Defines | Functions
room_gen_onion.c File Reference

The onion room generator: Onion rooms are like this: More...

#include <stdlib.h>
#include <global.h>
#include <random_map.h>
Include dependency graph for room_gen_onion.c:

Go to the source code of this file.

Defines

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

Functions

void bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 Create a bottom-centered layout.
void bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 Create a bottom-right-centered layout.
void centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 Creates a centered onion layout.
void draw_onion (char **maze, float *xlocations, float *ylocations, int layers)
 Draws the lines in the maze defining the onion layers.
void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options)
 Add doors to the layout.
char ** map_gen_onion (int xsize, int ysize, int option, int layers)
 Generates an onion layout.

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

######################### ######################### # # # # # ######## ########## # # ##################### # # # # # # # # # ###### ######## # # # # # # # # # # # # # ######## ######## # # # #### ###### # # # # # # # # # # # # # # # # # # # # # # ############ # # # # # # ########### ## # # # # # # # # # # # # # ################ # # # # # # ######### # # # # # # # # # # #################### # # # # # # # # # # # # # # ######################### #########################

Definition in file room_gen_onion.c.


Define Documentation

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

Function Documentation

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 224 of file room_gen_onion.c.

References draw_onion(), make_doors(), MIN, and OPT_IRR_SPACE.

Referenced by map_gen_onion().

Here is the call graph for this function:

Here is the caller graph for this function:

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 460 of file room_gen_onion.c.

References draw_onion(), make_doors(), MIN, and OPT_IRR_SPACE.

Referenced by map_gen_onion().

Here is the call graph for this function:

Here is the caller graph for this function:

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 149 of file room_gen_onion.c.

References draw_onion(), make_doors(), MIN, and OPT_IRR_SPACE.

Referenced by map_gen_onion().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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 344 of file room_gen_onion.c.

References OPT_BOTTOM_C, OPT_BOTTOM_R, OPT_LINEAR, and OPT_NO_DOORS.

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

Here is the caller graph for this function:

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 85 of file room_gen_onion.c.

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, and OPT_WALLS_ONLY.

Referenced by layoutgen(), and make_square_spiral_layout().

Here is the call graph for this function:

Here is the caller graph for this function: